cascardo/linux.git
12 years agoMerge branch 'chromeos-verity-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:58 +0000 (00:06 -0700)]
Merge branch 'chromeos-verity-3.4' into chromeos-3.4

By Mandeep Singh Baines (21) and others
* chromeos-verity-3.4: (48 commits)
  CHROMIUM: verity: Add stats on block sizes
  CHROMIUM: verity: Add a debugfs interface with basic stats access
  CHROMIUM: verity: Add a few comments about the statistics variables
  CHROMIUM: verity: Add a name for each verity instance
  CHROMIUM: verity: make total_requeues a uint64
  CHROMIUM: verity: honor optional salt argument.
  CHROMIUM: dm-bht: add salt support.
  CHROMIUM: init: don't dm_substitute_devices().
  CHROMIUM: verity: embed hash_desc instead of allocating it
  CHROMIUM: verity: use one shared queue per processer
  CHROMIUM: dm-verity: optionally support key-val args
  CHROMIUM: verity: use alloc_page instead of mempool_alloc
  CHROMIUM: verity: convert depth to an int
  CHROMIUM: verity: statically allocate root_digest
  CHROMIUM: verity: use block instead of block_index everywhere
  CHROMIUM: verity: short-circuit dm_bht_populate
  CHROMIUM: verity: cleanup commenting of io_bht_populate
  CHROMIUM: verity: change type (u64) for io block and count
  CHROMIUM: verity: root hash should not rely on uninitialized memory
  CHROMIUM: verity: use high priority workqueues
  ...

12 years agoMerge branch 'chromeos-security-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:50 +0000 (00:06 -0700)]
Merge branch 'chromeos-security-3.4' into chromeos-3.4

By Will Drewry (22) and others
via Grant Grundler
* chromeos-security-3.4: (31 commits)
  CHROMIUM: ARM: r1->r0 for get/set arguments
  CHROMIUM: seccomp: set -ENOSYS if there is no tracer
  CHROMIUM: ARM: arch/arm: allow a scno of -1 to not cause a SIGILL
  CHROMIUM: arch/arm: select HAVE_ARCH_SECCOMP_FILTER
  CHROMIUM: arch/arm: move secure_computing into trace; respect return code
  CHROMIUM: arch/arm: add asm/syscall.h
  BACKPORT: samples/seccomp: fix dependencies on arch macros
  BACKPORT: seccomp: fix build warnings when there is no CONFIG_SECCOMP_FILTER
  BACKPORT: seccomp: ignore secure_computing return values
  BACKPORT: seccomp: use a static inline for a function stub
  BACKPORT: Documentation: prctl/seccomp_filter
  BACKPORT: x86: Enable HAVE_ARCH_SECCOMP_FILTER
  BACKPORT: ptrace,seccomp: Add PTRACE_SECCOMP support
  BACKPORT: seccomp: Add SECCOMP_RET_TRAP
  BACKPORT: signal, x86: add SIGSYS info and make it synchronous.
  BACKPORT: seccomp: add SECCOMP_RET_ERRNO
  BACKPORT: seccomp: remove duplicated failure logging
  BACKPORT: seccomp: add system call filtering using BPF
  BACKPORT: arch/x86: add syscall_get_arch to syscall.h
  BACKPORT: asm/syscall.h: add syscall_get_arch
  ...

12 years agoMerge branch 'chromeos-platform-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:41 +0000 (00:06 -0700)]
Merge branch 'chromeos-platform-3.4' into chromeos-3.4

By Benson Leung (12) and others
* chromeos-platform-3.4: (62 commits)
  CHROMIUM: thermal: Add debugfs metrics for fan state changes
  CHROMIUM: thermal: Fix thermal_zone_device_polling round_jiffies usage
  CHROMIUM: gpio: nm10: add device IDs of IVB LPC variants
  CHROMUM: thermal: change cdev->cur_state to enum
  CHROMIUM: gpio: nm10: fix driver removal problem
  CHROMIUM: thermal: Add a small delay before turning fans on
  CHROMIUM: low-mem: add "on" command and fix error case
  CHROMIUM: low-mem notifier: lower default, change units, enable disabling
  CHROMIUM: platform/x86/chromeos_laptop - export add_i2c functions
  CHROMIUM: platform/x86/chromeos_laptop - mxt224s settings adjust
  CHROMIUM: platform/x86/chromeos_laptop - add_probed_i2c_device
  CHROMIUM: platform/x86/chromeos_laptop - Add platform data for touchpad
  CHROMIUM: ACPI: Read TSC upon resume
  CHROMIUM: change low-mem to chromeos-low-mem in /sys/kernel/mm.
  Add Panther Point to the list of gpio controllers
  CHROMIUM: chromeos_laptop: fix ALS entries
  CHROMIUM: platform/x86/chromeos_laptop - support multiple link tp
  CHROMIUM: platform/x86/chromeos_laptop - Use i2c_new_probed_device
  CHROMIUM: platform/x86 - fix compiler warning for args of bus_find_devices
  CHROMIUM: platform/x86/chromeos_laptop - Add atmel_mxt_tp for Link
  ...

12 years agoMerge branch 'chromeos-misc-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:28 +0000 (00:06 -0700)]
Merge branch 'chromeos-misc-3.4' into chromeos-3.4

By Dylan Reid (6) and others
* chromeos-misc-3.4: (37 commits)
  CHROMIUM: tpm: reconcile mainline changes with resume strategy
  CHROMIUM: r8169.c: Re-enable MSI to fix D3 wake for RTL8111e.
  CHROMIUM: r8169: Disable WOL by default
  CHROMIUM: r8169: transition to D0 state at shutdown
  CHROMIUM: r8169: Enable WOL from Magic Packet by default
  CHROMIUM: r8169: Enable suspend when device is idle from boot.
  CHROMIUM: drivers: net: add module param for control of ASPM  disable
  ALSA: hda/realtek - set DMIC coefficients
  CHROMIUM: tpm: don't run self test during probe
  HACK: tpm: export tpm_continue_selftest for tpm_tis_i2c
  CHROMIUM: tpm: fix potential deadlock in resume_if_needed
  CHROMIUM: scheduler: panic if schedulin while atomic
  CHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.
  ALSA: hda/realtek - indicate jacks are black and on the left.
  CHROMIUM: ALSA: hda/ca0132 - Move headphones to port D.
  ALSA: hda/realtek - add a fixup for ACER's ZGB.
  CHROMIUM: ALSA: hda: cirrus: Add a quirk for Stumpy.
  ALSA: hda: ca0132: set eapd
  CHROMIUM: i2c: i801: enable irq for byte_by_byte transactions
  CHROMIUM: i2c: i801: enable irq for i801 smbus transactions
  ...

12 years agoMerge branch 'chromeos-intel_i2c-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:22 +0000 (00:06 -0700)]
Merge branch 'chromeos-intel_i2c-3.4' into chromeos-3.4

By Daniel Kurtz (19) and others
* chromeos-intel_i2c-3.4: (21 commits)
  CHROMIUM: drm/i915/intel_i2c: Allow 400khz for cyapa
  CHROMIUM: drm/i915/intel_i2c: enable 400kHz GMBUS for atmel_mxt devices
  CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time
  UPSTREAM: drm/i915/intel_i2c: reduce verbosity of some messages
  UPSTREAM: drm/i915/intel_i2c: handle zero-length reads
  UPSTREAM: drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop
  UPSTREAM: drm/i915/intel_i2c: remove POSTING_READ() from gmbus transfers
  UPSTREAM: drm/i915/intel_i2c: use INDEX cycles for i2c read transactions
  UPSTREAM: drm/i915/intel_i2c: use WAIT cycle, not STOP
  UPSTREAM: drm/i915/intel_i2c: always wait for IDLE before clearing NAK
  UPSTREAM: drm/i915/intel_i2c: use double-buffered writes
  UPSTREAM: drm/i915/intel_i2c: handle zero-length writes
  UPSTREAM: drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private
  UPSTREAM: drm/i915/intel_i2c: gmbus disabled and reserved ports are invalid
  UPSTREAM: drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter
  UPSTREAM: drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers
  UPSTREAM: drm/i915/intel_i2c: assign HDMI port D to pin pair 6
  UPSTREAM: drm/i915/intel_i2c: cleanup error messages and comments
  UPSTREAM: drm/i915/intel_i2c: refactor gmbus_xfer
  UPSTREAM: drm/i915: enable gmbus on gen2
  ...

12 years agoMerge branch 'chromeos-input-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:15 +0000 (00:06 -0700)]
Merge branch 'chromeos-input-3.4' into chromeos-3.4

By Daniel Kurtz (51) and others
* chromeos-input-3.4: (79 commits)
  CHROMIUM: Input: atmel_mxt_ts - Add sysfs entry for r/w config file name
  CHROMIUM: Input: atmel_mxt_ts - Add sysfs entry for r/w fw file name
  CHROMIUM: Input: atmel_mxt_ts - Wait on auto calibration msg in suspend
  CHROMIUM: Input: atmel_mxt_ts - Support the case with no platform data
  CHROMIUM: Input: atmel_mxt_ts - Set default irqflags when there is no pdata
  CHROMIUM: Input: atmel_mxt_ts - Move object from sysfs to debugfs
  CHROMIUM: Input: atmel_mxt_ts - add deltas and refs debugfs entries
  CHROMIUM: Input: atmel_mxt_ts - Wait for CHG after bootloader resets
  CHROMIUM: Input: atmel_mxt_ts - Wait for CHG assert in mxt_check_bootloader
  CHROMIUM: Input: atmel_mxt_ts - Cleanup load_fw
  CHROMIUM: Input: atmel_mxt_ts - Add IDLE/DEEP-SLEEP modes when suspend
  CHROMIUM: Input: atmel_mxt_ts - Read resolution from device memory
  CHROMIUM: Input: atmel_mxt_ts - Remove matrix size update
  CHROMIUM: Input: cyapa - refactor debugfs mutex init/destruction
  CHROMIUM: Input: atmel_mxt_ts - add debugfs infrastructure
  CHROMIUM: Input: atmel_mxt_tx - add matrix_size sysfs entry
  CHROMIUM: Input: atmel_mxt_ts - refactor input device creation
  CHROMIUM: Input: atmel_mxt_ts - register input device before request_irq
  CHROMIUM: Input: atmel_mxt_ts - verify info block checksum
  CHROMIUM: Input: atmel_mxt_ts - add sysfs entry to read info checksum
  ...

12 years agoMerge branch 'chromeos-gobi-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:06:10 +0000 (00:06 -0700)]
Merge branch 'chromeos-gobi-3.4' into chromeos-3.4

By ttuttle (33) and others
via Grant Grundler
* chromeos-gobi-3.4: (59 commits)
  CHROMIUM: qcusbnet: don't spew "failed to autoresume" by default
  CHROMIUM: gobi: fix compiler warnings
  CHROMIUM: gobi: don't wait forever to close qmi fds
  CHROMIUM: gobi: Raise QMI timeout to 2000ms.
  CHROMIUM: gobi: Add SYNC_UNINTERRUPTIBLE sync_flags, and use it.
  CHROMIUM: gobi: Make qc_register log message better.
  CHROMIUM: gobi: Return -ENODEV on probe failures.
  CHROMIUM: gobi: Make probe failures WARN, not ERROR.
  CHROMIUM: gobi: Print error codes in qmidms_getmeid.
  CHROMIUM: gobi: Log cid_free errors in client_free.
  CHROMIUM: gobi: poison urbs instead of killing in stopread
  CHROMIUM: gobi: Proper error handling in getmeid.
  CHROMIUM: gobi: Fail instead of zeroing MEID on failed getmeid.
  CHROMIUM: gobi: Rearrange error handling in qc_deregister.
  CHROMIUM: gobi: time out sync operations in register
  CHROMIUM: gobi: qc_deregister in qcnet_disconnect, not _unbind
  CHROMIUM: gobi: proper error handling in qc_register
  CHROMIUM: gobi: fail qcnet_probe when qc_register fails
  CHROMIUM: gobi: usbnet_probe failure is a warning
  CHROMIUM: gobi: Set FLAG_WWAN so we are named wwan%d
  ...

12 years agoMerge branch 'chromeos-base-3.4' into chromeos-3.4
Olof Johansson [Fri, 1 Jun 2012 07:05:14 +0000 (00:05 -0700)]
Merge branch 'chromeos-base-3.4' into chromeos-3.4

* chromeos-base-3.4: (72 commits)
  CHROMIUM: config: Enable USB audio.
  CHROMIUM: config: remove i386/chromeos-intel-menlow
  CHROMIUM: config: rerun oldconfig for 3.4
  CHROMIUM: Fix "Work around Intel GPU bug with some physical pages."
  CHROMIUM: Work around Intel GPU bug with some physical pages.
  CHROMIUMOS: config: Enable verbose logging in mac80211
  CHROMIUM: make it easier to skip architectures in kernelconfig
  CHROMIUM: config: Add bogus chromiumos-exynos5 until we have the real one
  CHROMIUM: drm/i915: Replace pin count BUG_ON with warning
  CHROMIUM: scripts: Allow prepareconfig to accept a destination
  CHROMIUM: acpi- add printk and dumpstack at acpi_disable/enable
  CHROMIUM: config: enable joystick drivers
  CHROMIUM: config: re-normalize split configs
  CHROMIUM: config: Enabling RT3090 WiFi module.
  CHROMIUM: kick lockup detector on resume
  CHROMIUM: config: turn on ZRAM and SWAP on x86 arches
  CHROMIUM: config: i386: Enable xhci (USB 3.0) module.
  CHROMIUM: config: x86_64: Enable xhci (USB 3.0) module.
  CHROMIUM: config: Re-enable net namespaces in the kernel.
  CHROMIUM: config: turn off some rtl wifi drivers on chromeos configs
  ...

12 years agoCHROMIUM: verity: Add stats on block sizes
Simon Glass [Sat, 24 Dec 2011 01:55:15 +0000 (17:55 -0800)]
CHROMIUM: verity: Add stats on block sizes

Verity receives requests of different lengths - some for a single 4KB block
and some for up to 128 blocks.

Track the number of requests of each length and make this available through
the /proc statistics. Also track hash block requests as a separate item.

BUG=chromium-os:25441
TEST=build and boot on Kaen; sudo mount -t debugfs deb /proc/sys/debug
cat /proc/sys/debug/dm-verity/*/stats

-2 I/O queue pending
0 Verify queue pending
378 Hash block requests
3 Total re-queues
2009 Total requests
89MB Total size
23032 Total blocks
1059 Requests of size 1-1 (4KB to 4KB), 4236KB, run.tot. = 4MB
183 Requests of size 2-3 (8KB to 12KB), 1752KB, run.tot. = 5MB
242 Requests of size 4-7 (16KB to 28KB), 4424KB, run.tot. = 10MB
220 Requests of size 8-15 (32KB to 60KB), 9220KB, run.tot. = 19MB
110 Requests of size 16-31 (64KB to 124KB), 8920KB, run.tot. = 27MB
84 Requests of size 32-63 (128KB to 252KB), 13276KB, run.tot. = 40MB
42 Requests of size 64-127 (256KB to 508KB), 14972KB, run.tot. = 55MB
69 Requests of size 128-255 (512KB to 1020KB), 35328KB, run.tot. = 89MB

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

12 years agoCHROMIUM: verity: Add a debugfs interface with basic stats access
Simon Glass [Sat, 24 Dec 2011 00:30:55 +0000 (16:30 -0800)]
CHROMIUM: verity: Add a debugfs interface with basic stats access

We want to be able to easily view statistics collected by verify. So create
a top-level dm-verity debugfs interface, with a subdirectory for each instance.

Export our basic statistics through this interface, with the filename 'stats'.

BUG=chromium-os:25441
TEST=build and boot on Kaen; sudo mount -t debugfs deb /proc/sys/debug
cat /proc/sys/debug/dm-verity/*/stats
-1 I/O queue pending
0 Verify queue pending
3 Total re-queues
1867 Total requests

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

12 years agoCHROMIUM: verity: Add a few comments about the statistics variables
Simon Glass [Sat, 24 Dec 2011 01:10:00 +0000 (17:10 -0800)]
CHROMIUM: verity: Add a few comments about the statistics variables

Add comments to explain the purpose of the statistics variables.

BUG=chromium-os:25441
TEST=build and boot on Kaen

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

12 years agoCHROMIUM: verity: Add a name for each verity instance
Simon Glass [Sat, 24 Dec 2011 01:03:41 +0000 (17:03 -0800)]
CHROMIUM: verity: Add a name for each verity instance

This will be useful for the proc interface we are about to add, so the user
can tell the various instances apart.

BUG=chromium-os:25441
TEST=build and boot on Kaen; ls /proc/dm-verity and see directory name

Change-Id: I365a8915f45ce8fbb2bd884f6534b061dd50c429
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14788
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: verity: make total_requeues a uint64
Simon Glass [Sat, 24 Dec 2011 00:30:43 +0000 (16:30 -0800)]
CHROMIUM: verity: make total_requeues a uint64

The variable can overflow, so just increase its size.

BUG=chromium-os:25441
TEST=build and boot on Kaen; look at value through proc interface.
It increments to 3 which seems reasonable

Change-Id: Idb8ced3b3e4e5c6f2d4b56386985c8d497f5fcc5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14787
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: verity: honor optional salt argument.
Elly Jones [Fri, 2 Sep 2011 17:19:21 +0000 (13:19 -0400)]
CHROMIUM: verity: honor optional salt argument.

Support the salt argument to supply a salt for the verity bht.

BUG=chromium-os:12138
TESTED_ON=Kaen
TEST=Adhoc
Build an image without http://gerrit.chromium.org/gerrit/7174. Check for lack of
'salt=' in dmesg. All should be well.
Build an image with http://gerrit.chromium.org/gerrit/7174. Check
for 'salt=' in dmesg. All should be well.

Change-Id: Id04131902366c10a78323885e065c4ae35fbef35
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/7175
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: dm-bht: add salt support.
Elly Jones [Wed, 31 Aug 2011 21:47:08 +0000 (17:47 -0400)]
CHROMIUM: dm-bht: add salt support.

BUG=chromium-os:12138
TEST=Adhoc
Built and booted (on Kaen).

Change-Id: Ie107271e6049f9dc27c8ebe3474f79a863ce5ce8
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/7033
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: init: don't dm_substitute_devices().
Elly Jones [Tue, 12 Jul 2011 21:53:02 +0000 (17:53 -0400)]
CHROMIUM: init: don't dm_substitute_devices().

With uuid+offset support in dm_get_device(), we don't need to substitute at all
here, and this code was kind of a wart.

BUG=chromium-os:17184
TEST=Adhoc
Booted. dmesg | grep device-mapper
Built a normal image for kaen, booted it successfully. This tests u-boot.
Build a normal image for any x86 board (I used x86-alex). Boot it. This tests
chromeos-firmware boot.
Modify your x86 image for vm using image_to_vm.sh (this doesn't work for Arm
yet). Make sure it boots in the VM. This tests legacy (syslinux) boot.
As for testing grub boot, you're on your own :)

Change-Id: I6c7f048a7ec8b6949a29c86aaa5b9ebec6545404
Reviewed-on: http://gerrit.chromium.org/gerrit/3970
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/6063
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoCHROMIUM: verity: embed hash_desc instead of allocating it
Mandeep Singh Baines [Wed, 10 Aug 2011 18:21:16 +0000 (11:21 -0700)]
CHROMIUM: verity: embed hash_desc instead of allocating it

This simplifies the code and saves a level of indirection.

I also discovered a leak in one of the dm_bht_create error paths
which is also fixed by this change.

BUG=chromium-os:9752
TEST=Ran unit tests from dm-verity.git.
     Ran platform_DMVerityCorruption and platform_DMVerityBitCorruption.
TESTED_ON=Alex

Change-Id: I243e8ffeb7ecf19d9a6a6386fc81fce646b0a6f6
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5673

12 years agoCHROMIUM: verity: use one shared queue per processer
Mandeep Singh Baines [Wed, 10 Aug 2011 16:32:34 +0000 (09:32 -0700)]
CHROMIUM: verity: use one shared queue per processer

Move from creating workqueues per instance of a verity target to sharing
workqueues across all targets.

BUG=chromium-os:9752
TEST=Ran platform_DMVerityCorruption and platform_DMVerityBitCorruption.
TESTED_ON=Alex

Change-Id: I8b07c456f8d475d4fb56a9ec8b73536e1c115470
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5672
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoCHROMIUM: dm-verity: optionally support key-val args
Elly Jones [Tue, 21 Jun 2011 15:37:42 +0000 (11:37 -0400)]
CHROMIUM: dm-verity: optionally support key-val args

BUG=chromium-os:15772
TEST=Adhoc
Build a normal image (I built for Kaen) and boot it. Nothing generates the new
argument format yet, so this code is not exercised, but the system still boots.
Build a recovery image (I also built this for Kaen), boot it, and do the
recovery procedure. Ensure the machine boots afterwards. This exercises the
optional error behavior argument.

Change-Id: Icfee3e85cc7fa18054cc3d9ce71281afd3233888
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5141
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoCHROMIUM: verity: use alloc_page instead of mempool_alloc
Mandeep Singh Baines [Fri, 22 Jul 2011 15:48:48 +0000 (08:48 -0700)]
CHROMIUM: verity: use alloc_page instead of mempool_alloc

I ran a quick test and verified that mempool_alloc we are never
hitting the remove_element path of mempool_alloc so the 8MB of
mempool memory is never actually used.

Since dm-verity is read-only, its not part of memory reclaim. So a
memory pool is not neccesary. Since we alloc with GFP_KERNEL, an
allocation failure is highly unlikely. If an allocation does fail,
we already have code to handle the failure.

By removing the memory pool, we save 8 MB of RAM and save 1 ms on boot:

[    0.974280] before mempool_create_page_pool
[    0.975345] after mempool_create_page_pool

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Also ran platform_BootPerfServer:

Before:

  seconds_power_on_to_login                                       8.81
  seconds_power_on_to_login{1}                                    8.76
  seconds_power_on_to_login{2}                                    9.24
  seconds_power_on_to_login{3}                                    8.83
  seconds_power_on_to_login{4}                                    8.76
  seconds_power_on_to_login{5}                                    8.84
  seconds_power_on_to_login{6}                                    8.86
  seconds_power_on_to_login{7}                                    8.86
  seconds_power_on_to_login{8}                                    8.86
  seconds_power_on_to_login{9}                                    8.97

  Mean:  8.87
  Stdev: 0.14

After:

  seconds_power_on_to_login                                       8.92
  seconds_power_on_to_login{1}                                    9.06
  seconds_power_on_to_login{2}                                    8.96
  seconds_power_on_to_login{3}                                    8.71
  seconds_power_on_to_login{4}                                    8.99
  seconds_power_on_to_login{5}                                    8.89
  seconds_power_on_to_login{6}                                    8.77
  seconds_power_on_to_login{7}                                    8.96
  seconds_power_on_to_login{8}                                    8.95
  seconds_power_on_to_login{9}                                    8.95

  Mean: 8.91
  Stdev 0.10

The difference between the two runs is within stdev.

Change-Id: I9eddf2f01e6d3f09a010622d09485fac0924a8db
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4584

12 years agoCHROMIUM: verity: convert depth to an int
Mandeep Singh Baines [Thu, 21 Jul 2011 22:33:40 +0000 (15:33 -0700)]
CHROMIUM: verity: convert depth to an int

This allows us to remove a couple of casts.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: Id91142d879204d61266ab940ac54fe7e0f76e955
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4519
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoCHROMIUM: verity: statically allocate root_digest
Mandeep Singh Baines [Thu, 21 Jul 2011 02:26:43 +0000 (19:26 -0700)]
CHROMIUM: verity: statically allocate root_digest

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: I96ed614444caeac93a7c4879c1f189265e98de44
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4466

12 years agoCHROMIUM: verity: use block instead of block_index everywhere
Mandeep Singh Baines [Sat, 23 Apr 2011 22:19:43 +0000 (15:19 -0700)]
CHROMIUM: verity: use block instead of block_index everywhere

This makes our use block consistent. block is also easier to type than
block_index.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: I9e13d0721238e4b30db6f031d02b2fc660cc7ea9
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4453

12 years agoCHROMIUM: verity: short-circuit dm_bht_populate
Mandeep Singh Baines [Sat, 23 Apr 2011 22:13:34 +0000 (15:13 -0700)]
CHROMIUM: verity: short-circuit dm_bht_populate

If a node is verified, so are all its parents. This is because we
verify top down. So we can break as soon as we see a verfied node.
Its parents are already verified and populated.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: I0ccaf3113bc3f31e3c061267a978cc0ca693ee5f
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4452

12 years agoCHROMIUM: verity: cleanup commenting of io_bht_populate
Mandeep Singh Baines [Sat, 23 Apr 2011 20:28:34 +0000 (13:28 -0700)]
CHROMIUM: verity: cleanup commenting of io_bht_populate

BUG=chromium-os:9752
TEST=Ran platform_DMVerityCorruption on H/W.

Change-Id: I3be2e448ab1e9d372608fe856493af9f4a785ff8
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4451

12 years agoCHROMIUM: verity: change type (u64) for io block and count
Mandeep Singh Baines [Sat, 23 Apr 2011 20:26:46 +0000 (13:26 -0700)]
CHROMIUM: verity: change type (u64) for io block and count

io block and count are not sectors so changing their type to u64.n
This a few casts and allows a bit of cleanup in other places.

BUG=chromium-os:9752
TEST=Ran platform_DMVerityCorruption on H/W.

Change-Id: Iae81bff1002354850e2e6f56eca8f150b31345d2
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4450
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoCHROMIUM: verity: root hash should not rely on uninitialized memory
Mandeep Singh Baines [Wed, 20 Jul 2011 22:45:33 +0000 (15:45 -0700)]
CHROMIUM: verity: root hash should not rely on uninitialized memory

Fixes a valgrind warning. This bug is harmless should so
not be considered critical.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests with USE=valgrind.

dm-verity.git Reviewed-on: http://gerrit.chromium.org/gerrit/4338

TBRing since it has no impact on kernel and has already been LGTMed
and committed to dm-verity.git

Change-Id: Ic2e03ac1edd3f779e048f39214833857c21b3b09
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4436

12 years agoCHROMIUM: verity: use high priority workqueues
Mandeep Singh Baines [Wed, 25 May 2011 23:57:42 +0000 (16:57 -0700)]
CHROMIUM: verity: use high priority workqueues

The workqueue infrastructure has completely changed since 2.6.32.

It is no longer one dedicated process per cpu per workqueue.

This CL seems to shave about 400 ms off of boot.

BUG=chromium-os:15409
TEST=platform_BootPerf

  seconds_power_on_to_login                                       7.18
  seconds_power_on_to_login{1}                                    7.22
  seconds_power_on_to_login{2}                                    7.37
  seconds_power_on_to_login{3}                                    7.46
  seconds_power_on_to_login{4}                                    7.26
  seconds_power_on_to_login{5}                                    7.19
  seconds_power_on_to_login{6}                                    7.12
  seconds_power_on_to_login{7}                                    7.09
  seconds_power_on_to_login{8}                                    7.24
  seconds_power_on_to_login{9}                                    7.2

Change-Id: I62f1ce0881d93247919710566b9ac7e26d44587c
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1608
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
12 years agoCHROMIUM: dm: pass up rotational flag
Mandeep Singh Baines [Wed, 25 May 2011 18:58:21 +0000 (11:58 -0700)]
CHROMIUM: dm: pass up rotational flag

Allow the NONROT flag to be passed through to linear mappings if all
underlying device are non-rotational. Tools like ureadahead will
schedule IOs differently based on the rotational flag.

With this patch, I see boot time go from 7.75 s to 7.46 s on my device.

BUG=chromium-os:15409
TEST=platform_DMVerityCorruption

Change-Id: I77421da9ca7fd803e3918390a604ee7285e10324
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Link: http://lkml.kernel.org/r/1306356648-30730-1-git-send-email-msb@chromium.org
Reviewed-on: http://gerrit.chromium.org/gerrit/1569
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: verity: pull up maybe_read_entry
Mandeep Singh Baines [Tue, 3 May 2011 00:43:27 +0000 (17:43 -0700)]
CHROMIUM: verity: pull up maybe_read_entry

Since the latest refactoring it is now possible to pull up maybe_read_entry.

I also removed the PENDING flag and instead just call is_populated.

BUG=chromium-os:13872
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: I59d7555dce53fc297662aef1a15d77521ef6f4cc
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6883252

12 years agoCHROMIUM: verity: remove compare_hash layer
Mandeep Singh Baines [Thu, 28 Apr 2011 18:48:19 +0000 (11:48 -0700)]
CHROMIUM: verity: remove compare_hash layer

We've refactored the code such that we are now only calling compare_hash
into two places in the same function. So we really don't need this layer
any more.

I plan to send a CL soonish that will remove the second call so we'll
be down to just the one call.

BUG=chromium-os:13872
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: Ieb20dfdcf425a3c423ebabf63f86d549c259c0f8
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6902084

12 years agoCHROMIUM: verity: remove explicit blk_unplug
Mandeep Singh Baines [Thu, 28 Apr 2011 18:47:16 +0000 (11:47 -0700)]
CHROMIUM: verity: remove explicit blk_unplug

The unplug call does not seem to have any effect on boot time so remove it.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Tested boot performance.

Before:

  seconds_power_on_to_login                                       10.33
  seconds_power_on_to_login{1}                                    11.04
  seconds_power_on_to_login{2}                                    11.05
  seconds_power_on_to_login{3}                                    11.04
  seconds_power_on_to_login{4}                                    11.02
  seconds_power_on_to_login{5}                                    11.05
  seconds_power_on_to_login{6}                                    11.06
  seconds_power_on_to_login{7}                                    11.22
  seconds_power_on_to_login{8}                                    11.04
  seconds_power_on_to_login{9}                                    11.04

After:

  seconds_power_on_to_login                                       10.98
  seconds_power_on_to_login{1}                                    10.35
  seconds_power_on_to_login{2}                                    11.07
  seconds_power_on_to_login{3}                                    11.06
  seconds_power_on_to_login{4}                                    11.04
  seconds_power_on_to_login{5}                                    11.08
  seconds_power_on_to_login{6}                                    11.37
  seconds_power_on_to_login{7}                                    11.04
  seconds_power_on_to_login{8}                                    11.09
  seconds_power_on_to_login{9}                                    11.05

Change-Id: I8bb45bc269690efc6b90f1c74a09b12b0de94010
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6903052

12 years agoCHROMIUM: verity: remove max_bios module parameter
Mandeep Singh Baines [Thu, 28 Apr 2011 16:04:46 +0000 (09:04 -0700)]
CHROMIUM: verity: remove max_bios module parameter

This option is never enabled so remove it.

BUG=chromium-os:9752
TEST=Ran platform_DMVerityCorruption on H/W.

Change-Id: I2c6119fae9f541a57043d5a8162a923868f212e9
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6903077

12 years agoCHROMIUM: verity: remove special-case logic for the root node
Mandeep Singh Baines [Mon, 25 Apr 2011 23:46:43 +0000 (16:46 -0700)]
CHROMIUM: verity: remove special-case logic for the root node

Now that the root-node is the same width as the interior nodes
of the hash tree, we no longer need to make it a special case.

BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: I5faf43b2ec6e563f77966c7b8b62eb64cfc73198
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6896044

12 years agoCHROMIUM: verity: change maybe_read_entries to maybe_read_entry
Mandeep Singh Baines [Thu, 14 Apr 2011 16:54:11 +0000 (09:54 -0700)]
CHROMIUM: verity: change maybe_read_entries to maybe_read_entry

Since root is guaranteed to be a single block we no longer need to
read multiple entries in maybe_read_entries.

BUG=9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: Ic12332fe9b9cd283151a43181b2dfaae13c50ff5
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org,ups@chromium.org

Review URL: http://codereview.chromium.org/6821076

12 years agoCHROMIUM: verity: don't call page_address on unmapped highmem pages
Mandeep Singh Baines [Wed, 13 Apr 2011 21:37:51 +0000 (14:37 -0700)]
CHROMIUM: verity: don't call page_address on unmapped highmem pages

This fixes a bug that is preventing ARM systems from booting with verity.

We were calling page_address on what could potentially have been an
unmapped highmem page. Fix is to pass the struct page to the crypto code
and let crypto handle the kmap/kunmap.

BUG=chromium-os:14089,chrome-os-partner:3287
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.
Verified that ARM now boots.

Change-Id: Id2074052aab9eec8fa0aead39aded2b40cd19bad
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,olofj@chromium.org,taysom@chromium.org

Review URL: http://codereview.chromium.org/6835032

12 years agoCHROMIUM: verity: remove the depth parameter from bht_create
Mandeep Singh Baines [Mon, 11 Apr 2011 21:45:19 +0000 (14:45 -0700)]
CHROMIUM: verity: remove the depth parameter from bht_create

We want to only support regular tries with a single root hash block.

BUG=chromium-os9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

verity.git Review URL: http://codereview.chromium.org/6811030

TBRing. Already LGTMed and committed into verity.git

Change-Id: I17e7bce45c1d541dd15bb531591279d832d5a4a0
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
R=wad@chromium.org,taysom@chromium.org,ups@chromium.org

Review URL: http://codereview.chromium.org/6821059

12 years agoCHROMIUM: verity: re-sync with version from 2.6.32 branch
Mandeep Singh Baines [Wed, 6 Apr 2011 21:45:52 +0000 (14:45 -0700)]
CHROMIUM: verity: re-sync with version from 2.6.32 branch

The version in 2.6.37/38 is way behind. This change catches it up. I did
have to drop 27c5d624 "CHROMIUM: dm-verity: Propagate QUEUE_FLAG_NONROT"
which was causes the unit tests to fail. I will investigate and fix this
in a future change. We currently do not have this change in 2.6.37/38
so there is no regression.

BUG=chromium-os:13872
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.

Change-Id: Ifcae5d573092f0d0e50232d105a6f2f84bf00a48
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=7d7f080

Review URL: http://codereview.chromium.org/6804018

12 years agoCHROMIUM: verity: fixups for 2.6.38
Olof Johansson [Fri, 18 Mar 2011 17:18:14 +0000 (10:18 -0700)]
CHROMIUM: verity: fixups for 2.6.38

Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoCHROMIUM: Convert BIO->REQ for dm-verity-chromeos
Will Drewry [Tue, 11 Jan 2011 18:47:46 +0000 (12:47 -0600)]
CHROMIUM: Convert BIO->REQ for dm-verity-chromeos

In recent kernels, the status flags are separate from the
request flags.  This brings dm-verity-chromeos.c into parity.

Signed-off-by: Will Drewry <wad@chromium.org>
BUG=chromium-os:9697
TEST=builds for kernel next;  kernel part is corruption test in progress

Review URL: http://codereview.chromium.org/6188001

Change-Id: Id65b14757dc857a975a1039513a8dfdee003b27c

12 years agoCHROMIUM: dm-verity: refactor error handling
Will Drewry [Tue, 11 Jan 2011 18:47:23 +0000 (12:47 -0600)]
CHROMIUM: dm-verity: refactor error handling

- Support a "notify" error case
- Add support for a generic error notification framework
- Move ChromeOS platform error handling to a new file

TEST=testing of the notifier based system is still in progress.
BUG=chromium-os:8442

Change-Id: Ic7e89041bc08220008011bb279de2f90b19bb881
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/4854001
(copied fom kernel.git)

Review URL: http://codereview.chromium.org/6186002

12 years agoCHROMIUM: dm-verity: add a chromeos-specific error target
Will Drewry [Tue, 11 Jan 2011 18:46:18 +0000 (12:46 -0600)]
CHROMIUM: dm-verity: add a chromeos-specific error target

Adds a "cros" error target that will write DMVERROR to the first 8
bytes of the partition preceding the configured target (e.g., /dev/sda3-/dev/sda2)
if it contains CHROMEOS already.  If the error is non-terminal (ENOMEM, transient I/O
failure, etc) it will just panic.

If failure to read/write to the kernel partition occurs, it will trigger a
reboot-to-recovery.

TEST=built a recovery kernel and make a dev_shim to boot to a shell. From there I setup a dm-verity device fro the sda3 on the installed system.  I gave it an invalid root hash.  I then mounted the dm-0 device which triggered a failure during validation.  It properly invalidated the kernel partition.
BUG=chromium-os:8442

Change-Id: I6aa095b976a20ab444fb7b1188fe9e2d55403b39
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/4430004
(copied from kernel.git)

Review URL: http://codereview.chromium.org/6147002

12 years agoCHROMIUM: verity: remove pass-through barrier code [2.6.37]
Olof Johansson [Thu, 25 Nov 2010 05:19:50 +0000 (23:19 -0600)]
CHROMIUM: verity: remove pass-through barrier code [2.6.37]

Change-Id: I9005868db5fbd626bfef5b0e2ca1738465738dc2
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoCHROMIUM: dm-verity: double bio_put() on backing disk requests
Will Drewry [Fri, 5 Nov 2010 17:46:57 +0000 (12:46 -0500)]
CHROMIUM: dm-verity: double bio_put() on backing disk requests

(Note, this is a first pass. It seems to work, but I'll cross check it more
 thoroughly tomorrow!)

When reading from the backing drive, a request will be cloned and optionally
padded.  Cloning always happens, if a request is padded, it is cloned twice.

On error, we were automatically calling bio_put() on the bio in the IO context
and the one that had the error even when it wasn't double cloned.  This change
adds the test I use elsewhere to see if the base_bio is the same as the one in
the IO context.  If it is, then the request was single-cloned(), if not, we need
to have the extra bio_put().

TEST=
1. created a new recovery kernel with mod_image_for_recovery.sh --kernel_image_only
2. Ran make_developer_script_runner.sh --developer_script shwrapper.sh
3. dd'd the output to a usb stick
4. Booted in dev mode
5. chrooted to my local system's /dev/sda3
6. create a verity table and hash file in /dev/sda1 for /dev/sdb1
7. created a loop0 for the hashes
8. Pulled out the usb stick and put it back in so it'd be /dev/sdc
9. Setup the dm device with dmsetup create -r foo --table "table output"
10. dd if=/dev/dm-0 of=/dev/null
11. echo 3 > /proc/sys/vm/drop_caches
12. dd if=/dev/dm-0 of=/dev/null bs=513 skip=2  and pull the stick out right after hitting enter
13. Check dmesg | tail.  The Error occurred message is there, but it successfully recovers.!
BUG=chromium-os:8499

Change-Id: I6b5a89a7de75028724e2a177b871bf02b766bc4b
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/4293001

12 years agoCHROMIUM: dm-bht: fix invalid mempool_free call
Will Drewry [Thu, 28 Oct 2010 21:25:21 +0000 (16:25 -0500)]
CHROMIUM: dm-bht: fix invalid mempool_free call

dm-bht allocates pages from a page pool, then uses the virtual address most of
the time.  This flip-flopped a few times and the result is that the
mempool_free call is using the virtual address instead of the page pointer that
was yielded from the page pool.

This change fixes that oversight simply with  virt_to_page() call.  In the
future, this should be cleaned up to just keep the page around and use
page_address() calls when the virtual address is needed.

The reason this fix is preferable for now is that it doesn't impact any of the
active use code - just device removal which only occurs in the recovery
scenario.

TEST=recovery dmsetup remove calls no longer panic()
BUG=chromium-os:7451

Change-Id: I7d7493b55f6ae8668d5e5e8dc3a347be84878afc
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/4163004

12 years agoCHROMIUM: verity: build fix for init/do_mounts_dm.c
Olof Johansson [Wed, 10 Nov 2010 22:53:13 +0000 (16:53 -0600)]
CHROMIUM: verity: build fix for init/do_mounts_dm.c

Change-Id: I714e012cae492c58311e096455e924c0c8fb3614
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: verity: remove depend on !PREEMPT
Olof Johansson [Wed, 10 Nov 2010 21:47:06 +0000 (15:47 -0600)]
CHROMIUM: verity: remove depend on !PREEMPT

Change-Id: I7e7ef281037bf41780867e4d2f9d834f08d31558
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: verity: 2.6.36 build fix
Olof Johansson [Tue, 9 Nov 2010 23:05:41 +0000 (17:05 -0600)]
CHROMIUM: verity: 2.6.36 build fix

Change-Id: I0ab2d79819bab1c11ec0d3bf8adc77aad55d2afb
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: dm-verity: add hooks to chromeos_platform
Olof Johansson [Thu, 2 Sep 2010 17:18:54 +0000 (12:18 -0500)]
CHROMIUM: dm-verity: add hooks to chromeos_platform

Change-Id: I2a9b557e9f25fa0b03dbae2feaba20a6fd73335a
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: dm-verity: enable target specific error behavior
Will Drewry [Mon, 30 Aug 2010 21:50:53 +0000 (16:50 -0500)]
CHROMIUM: dm-verity: enable target specific error behavior

~~
Patch 1/4: Please take a look across all of them if you can.
While I think we could centralize much of the platform specific logic
in something like a chromeos_behavior module, I'm not sure if it is
worth doing just yet.  These patches show some of the added uses we
might have.  (In addition, I can see us wanting to probe for devmode
v recovery mode at kernel-time as well.)
~~

Allow a target to optionally override the global error_behavior for a
target. This will allow one device to cause a reboot or another to just
return EIOs.  Without this, it is impossible to test bad targets on a
machine with aggressive error behavior.

Change-Id: Ia97acd3c03882d3032d14a2cf8dd13bbcf3d0f4d
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/3111035

12 years agoCHROMIUM: make dm= boot path wait for devices
Will Drewry [Fri, 23 Jul 2010 17:33:12 +0000 (12:33 -0500)]
CHROMIUM: make dm= boot path wait for devices

Prior to configuring mapped drives, we attempted to pre-resolve devices
out of the table configurations using the same logic as the other init
code.  However, like md, this may occur before devices are available.

This means that dm booting to a USB device will likely fail.  This
change adds root_wait-style code during device name resolution.  If the
device is not present, then the system will be blocked anyway.  If it
resolves after some period, then we can proceed. If the device resolves
immediately, then we never use this code.

It's worth noting that this will NOT wait for major:minor specified
devices.  I think that's probably okay, but it could be added if it makes
sense.  (forking this off to a separate function which rewalks looking for
' /dev/' or  ' digit*:digit* ')

Signed-off-by: Will Drewry <wad@chromium.org>
TEST=built a kernel and booted a verified rootfs off of usb with it
BUG=chromium-os:327

Change-Id: I350b4deceeeff3c499b4c3e00e4d7ae0645f8b16

Review URL: http://codereview.chromium.org/3059004

12 years agoCHROMIUM: add UUID device selection to dm-verity
Will Drewry [Fri, 6 Aug 2010 20:40:03 +0000 (15:40 -0500)]
CHROMIUM: add UUID device selection to dm-verity

This changes addes UUID and UUID+1 based device selection to dm-verity.
If a table provides UUID or UUID+1 as the backing device or hash device
then it will use the found device or the best guess at the +1 partition
after that device.

It allows the firmware to provide the UUID of the kernel partition and
automatically select the root partition (+1) for for kernel-a or
kernel-b.

As a bonus, the refactoring of the device retrieval also let me fold in
device waiting.  If a usb device isn't ready on dm="" setup, it will
rescan if dm_verity.dev_wait=1 is set.

Signed-off-by: Will Drewry <wad@chromium.org>
EST=manual build and use. Requires EFI_PARTITION for the GUID booting
BUG=chromium-os:5081

Review URL: http://codereview.chromium.org/3050041

Change-Id: I2d59ae00bc852a889eaf74a1a82101fb6d6db209

12 years agodm_verity: remove pre-.33-skip_spaces
Olof Johansson [Sat, 26 Jun 2010 04:07:04 +0000 (23:07 -0500)]
dm_verity: remove pre-.33-skip_spaces
dm_get_device arg changes

Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoCHROMIUM: dm-verity: initial cut
Will Drewry [Wed, 9 Jun 2010 22:06:22 +0000 (17:06 -0500)]
CHROMIUM: dm-verity: initial cut

First cut of dm-verity and dm-bht.  This implements a hash-based block
device verification dm module.

[It still needs work, but I'd love to be able to start doing iterative changes and not working on big, unchecked in blobs :)]

BUG=327
TESTS=automated:
      - dm-bht are coming in the verity cl
      - autotests need to be written for testing live
      manual:
      - by mounting /dev/sda5 with a rootfs on it and using a loop device with the hashes;
      - ran with slub debug FPZ: discovered dm-io bug which is no longer used in the code
      - ran dd on the raw device with block sizes from 4k - 1M and counts from 1 to full disk, skip as well
        - uncovered lock-ups in io_populate loop and oom conditions with initial dm_bht_populate flood of
          I/O requests (max_bios)
      - base tests on ref show ~25mb/s.  autotests to follow

Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/1921007

12 years agoCHROMIUM: dm: boot time specification of dm=
Will Drewry [Wed, 9 Jun 2010 22:47:38 +0000 (17:47 -0500)]
CHROMIUM: dm: boot time specification of dm=

This is a wrap-up of three patches pending upstream approval.
I'm bundling them because they are interdependent, and it'll be
easier to drop it on rebase later.

1. dm: allow a dm-fs-style device to be shared via dm-ioctl

Integrates feedback from Alisdair, Mike, and Kiyoshi.

Two main changes occur here:

- One function is added which allows for a programmatically created
mapped device to be inserted into the dm-ioctl hash table.  This binds
the device to a name and, optional, uuid which is needed by udev and
allows for userspace management of the mapped device.

- dm_table_complete() was extended to handle all of the final
functional changes required for the table to be operational once
called.

2. init: boot to device-mapper targets without an initr*

Add a dm= kernel parameter modeled after the md= parameter from
do_mounts_md.  It allows for device-mapper targets to be configured at
boot time for use early in the boot process (as the root device or
otherwise).  It also replaces /dev/XXX calls with major:minor opportunistically.

The format is dm="name uuid ro,table line 1,table line 2,...".  The
parser expects the comma to be safe to use as a newline substitute but,
otherwise, uses the normal separator of space.  Some attempt has been
made to make it forgiving of additional spaces (using skip_spaces()).

A mapped device created during boot will be assigned a minor of 0 and
may be access via /dev/dm-0.

An example dm-linear root with no uuid may look like:

root=/dev/dm-0  dm="lroot none ro, 0 4096 linear /dev/ubdb 0, 4096 4096 linear /dv/ubdc 0"

Once udev is started, /dev/dm-0 will become /dev/mapper/lroot.

Older upstream threads:
http://marc.info/?l=dm-devel&m=127429492521964&w=2
http://marc.info/?l=dm-devel&m=127429499422096&w=2
http://marc.info/?l=dm-devel&m=127429493922000&w=2

Latest upstream threads:
https://patchwork.kernel.org/patch/104859/
https://patchwork.kernel.org/patch/104860/
https://patchwork.kernel.org/patch/104861/

Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/2020011

Change-Id: I92bd53432a11241228d2e5ac89a3b20d19b05a31

12 years agoRevert "dm: add verity target"
Grant Grundler [Wed, 18 Apr 2012 21:53:06 +0000 (21:53 +0000)]
Revert "dm: add verity target"

This reverts commit a4ffc152198efba2ed9e6eac0eb97f17bfebce85.

We're still going to use our own verity stack for 3.4, but we're trying
hard to get moved over for the next upstream rebase. So revert the version
that went in for 3.4 this time.

Change-Id: Id702da971530dd94c3aaa60dee2279f036d8fa2e
Signed-off-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: thermal: Add debugfs metrics for fan state changes
Jonathan Kliegman [Wed, 23 May 2012 01:07:59 +0000 (01:07 +0000)]
CHROMIUM: thermal: Add debugfs metrics for fan state changes

Gather stats for:
  # fans currently in delay
  # times a fan failed to turn on due to temperature drop
  # times multiple fans triggered at once
  # times a fan turned on

BUG=chromium-os:30526
TEST=manual inspection of debugfs values while adjusting temperature
  trybot runs of amd64, x86, tegra2 paladins and amd64 full

Change-Id: I07368e9260f69482e16674ddab826314bde7e22b
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22176
[olofj: build fix due to printk changes]
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: thermal: Fix thermal_zone_device_polling round_jiffies usage
Jonathan Kliegman [Wed, 9 May 2012 17:35:58 +0000 (13:35 -0400)]
CHROMIUM: thermal: Fix thermal_zone_device_polling round_jiffies usage

round_jiffies is meant to be called on an absolute time, not a delta.
Adjust the logic to round the absolute time the delay would run to, but
only if we're not in delay to prevent the next poll finishing just
ahead of the cdev->delay_until value.

BUG=chromium-os:30230
TEST=Add debug output to /var/log/messages and observe delay value.
  See it rounded just under 10 seconds in most cases, but be
  exactly 2 seconds when in delay

Change-Id: If2f35457c2f0c307fb4670ab108626be4ce2acfd
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22247
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: gpio: nm10: add device IDs of IVB LPC variants
Vadim Bendebury [Sat, 12 May 2012 01:12:34 +0000 (18:12 -0700)]
CHROMIUM: gpio: nm10: add device IDs of IVB LPC variants

These PCI device IDs describe various variants of the Ivy Bridge
chipset South Bridge LPC device (00:1f.0), which includes the GPIO
controller.

BUG=none
TEST=manual
      . with this fix the driver installs on the most recent hardware
        where it was failing to install before

Change-Id: Iaff6c1f1bdc7ec977329b0693e672d302824fa58
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22517
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMUM: thermal: change cdev->cur_state to enum
Jonathan Kliegman [Wed, 9 May 2012 17:49:17 +0000 (13:49 -0400)]
CHROMUM: thermal: change cdev->cur_state to enum

Use an enum for state values to make code simpler.

BUG=chromium-os:30315
TEST=trybot run on x86, amd64, and tegra2 paladins
  Deploy to device and observe fan behavior is correct

Change-Id: I405c9c75404ccec2e8cf51e5269f3a1fda090893
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22251
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: gpio: nm10: fix driver removal problem
Vadim Bendebury [Sat, 24 Mar 2012 02:21:40 +0000 (10:21 +0800)]
CHROMIUM: gpio: nm10: fix driver removal problem

The order of operations in the driver remove method is wrong, which
prevents the driver from de-installing.

BUG=none
TEST=manual

  . try 'rmmod nm10_gpio' and 'modprobe nm10_gpio' a few times in a
    row, check the dmesg output to see that the driver installs and
    removes cleanly

Change-Id: I7ab5161f224722f4f23fec97c99116184959a64e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19019
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: thermal: Add a small delay before turning fans on
Jonathan Kliegman [Wed, 9 May 2012 02:28:01 +0000 (02:28 +0000)]
CHROMIUM: thermal: Add a small delay before turning fans on

To prevent fans turning on due to brief spikes, if a normal fan
would be turned on schedule a second check shortly afterwards and
only turn on if the temperature remains above the threshold.

The second check is controlled by
/sys/class/thermal/thermal_zone%d/fan_on_delay which sets
the amount of time (in seconds) to delay.  A value of 0 indicates
to turn the fan on immediately.  2 seconds is the default.

Only apply this change to the normal fans, and not critical ones.

BUG=chrome-os-partner:8456
TEST=With fan_on_delay=0, run temperature up and see fans turn
    on the first poll period crossing the threshold.
  Set fan_on_delay to 2, see second checks scheduled and fans
    turn on 2 seconds temperature.
  Set fan_on_delay to 40, see fans turn on two cycles after turning on.
    Lower temperature after second check is scheduled, observe fans
      staying off.
    Lower fans under and raise above after one check has passed. See
      delay reset to 40 seconds.

Change-Id: I93afba62926ebe2359f8fd28b0ffa90417e61ba8
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19710
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: tpm: reconcile mainline changes with resume strategy
Luigi Semenzato [Tue, 22 May 2012 23:55:38 +0000 (16:55 -0700)]
CHROMIUM: tpm: reconcile mainline changes with resume strategy

Our local changes were no longer compatible with the mainline changes
to tpm_continue_selftest.  This introduces the helper function
tpm_continue_selftest_nocheck, which avoids recursion in transmit_cmd.
A large comment also attempts to explain more clearly what is going
on.

The new mainline function tpm_do_selftest hides differences between
TPMs by calling tpm_continue_selftest, then checking if the self test
has completed or not.  (TPM_ContinueSelfTest unfortunately allows
both behaviors.)  This probably works fine, but it would add hundreds
of milliseconds to our resume path.

This fix is necessary because our version of tpm_continue_selftest
was not returning an error code, but the length of the response packet,
which was interpreted as a weird error code.

To test, I ran "powerd_suspend; tpmc getvf", looked at the log, and
noted that waiting for the self test to complete would have cost us
over 300ms.

BUG=chromium-os:31065
TEST=manual test

Change-Id: Iff09a9759c31ea93cd58c7ba32114b04e67e2359
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23299
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: r8169.c: Re-enable MSI to fix D3 wake for RTL8111e.
Todd Broch [Sat, 26 May 2012 00:41:44 +0000 (17:41 -0700)]
CHROMIUM: r8169.c: Re-enable MSI to fix D3 wake for RTL8111e.

In 3.0, kernel function, rtl_try_msi, unconditionally wrote config2
(0x53) register regardless of device version.

In 3.2, this write was made conditional based off dialog found in
https://lkml.org/lkml/2011/12/14/19.  That dialog states that MSI is
only supported for r8169 series devices.  Datasheets I have state MSI
support is available for the RTL81111e device I'm testing.
Additionally, I'm able to see the correct reporting of the MSI by
interrogating the PMCSR and /proc/interrupts.

This temporary patch returns the driver to its 3.0 functionality of
unconditionally writing config2 register while I begin a dialog with
maintainer/vendor to resolve the larger issue.

BUG=chromium-os:27991
TEST=manual
1. boot kernel w/o LAN connected and goto shell.
2. lspci -vvv -s 02:0 | grep "Status: D"
  Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
3. connect LAN and repeat 2.
  Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-

Change-Id: Ifbef2a63ab68a25954910a613ccc9def542fe612
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19399
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: r8169: Disable WOL by default
Todd Broch [Fri, 24 Feb 2012 01:15:46 +0000 (17:15 -0800)]
CHROMIUM: r8169: Disable WOL by default

Set the WOL config registers to be disabled by default. Without this change in
place, the WOL config register settings on warm reboot come up in an
inconsistent state since these registers don't get reset on a warm reboot.

BUG=chrome-os-partner:7026
TEST=On a system with a realtek ethernet MAC, do the following
test1,
  1. run "ethtool -s eth0 wol g" to enable WOL from PHY activity
  2. reboot the system
  3. run "ethtool eth0" and check that "g" is not listed in "Wake-on"

test2, Run network_EthCapsServer.py and make sure it still wakes

test3, Measure power during S3 from cold-boot see ~100mW less with WOL disabled

Change-Id: I469b0fc7cac17bf612be3229b8c1770bcd237df6
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/16432
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: r8169: transition to D0 state at shutdown
Sameer Nanda [Sat, 26 May 2012 00:37:27 +0000 (17:37 -0700)]
CHROMIUM: r8169: transition to D0 state at shutdown

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor.

This patch transitions the device back to D0 state in rtl_shutdown if
the device was runtime PM suspended. In addition, since runtime PM
also mucks around with WOL options, the saved WOL options are also
restored in rtl_shutdown.

BUG=chrome-os-partner:7026
TEST=Don't have a good black box test case. It can be tested by
modifying the driver to verify that register accesses in
rtl_shutdown go through with the cable disconnected.

Change-Id: Ic08f2c3fed22a4b1a876dc3816565156b464ec78
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15832
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: r8169: Enable WOL from Magic Packet by default
Sameer Nanda [Sat, 26 May 2012 00:28:38 +0000 (17:28 -0700)]
CHROMIUM: r8169: Enable WOL from Magic Packet by default

Set the WOL config registers to only enable WOL from magic packet by
default. Without this change in place, the WOL config register
settings on warm reboot come up in an inconsistent state since these
registers don't get reset on a warm reboot.

BUG=chrome-os-partner:7026
TEST=On a system with a realtek ethernet MAC, do the following
1. run "ethtool -s eth0 wol p" to enable WOL from PHY activity
2. reboot the system
3. run "ethtool eth0" and check that "p" is not listed in "Wake-on"

Change-Id: Iee843b5a93c04a9463342bd87dc03078d37e2ef0
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15831
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: r8169: Enable suspend when device is idle from boot.
Todd Broch [Wed, 28 Dec 2011 21:02:47 +0000 (13:02 -0800)]
CHROMIUM: r8169: Enable suspend when device is idle from boot.

The r8169 driver supports power management and correctly transistions
from active to suspend when link transistions from connected to
disconnected.  If its not connected at boot however the device remains
active after the initial probe.

This change adds a check of the link status to the idle pm_op that
will schedule a suspend if inactive.

BUG=chrome-os-partner:7360
TEST=manual
1. boot connected to LAN.  Interface works and continues to work after
disconnect & connect.

2. boot without connected to LAN.  Device's status,
/sys/bus/pci/devices/<devnum>/power/runtime_status is 'suspended'.
Connecting LAN brings up interface and transitions to 'active'.  Test
multiple connect/discoonect still functions

Change-Id: Ia9a5cc300faebbac63f77e3b7eb7cb08491f671e
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13516

12 years agoCHROMIUM: drivers: net: add module param for control of ASPM disable
Todd Broch [Sat, 26 May 2012 00:06:31 +0000 (17:06 -0700)]
CHROMIUM: drivers: net: add module param for control of ASPM  disable

ASPM has been disabled in this driver by default as its been
implicated in stability issues on at least one platform.  This CL adds
a  module parameter to allow control of ASPM disable.  The default
value is disabled to match the current upstream functionality.

BUG=chrome-os-partner:6691
TEST=manual,
1. Test default
- boot kernel on platform w/ r8169
- lspci -vvv -s <device> | grep -i aspm
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency
   L0 unlimited, L1 <64us
LnkCtl:    ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain-
   CommClk+
  - Note, 'ASPM L1 Enabled'

2. Test Disabling ASPM
- echo "options r8169 aspm_disable=1" > /etc/modprobe.d/r8169.conf
- re-boot
- lspci -vvv -s <device> | grep -i aspm
   LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency
   L0 unlimited, L1 <64us
LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- Retrain-
   CommClk+
  - Note, 'ASPM Disabled'

Change-Id: Iae399c08a917fcc7421cb63fb34e9cebca4ab296
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11551

12 years agoALSA: hda/realtek - set DMIC coefficients
Dylan Reid [Fri, 11 May 2012 03:42:01 +0000 (20:42 -0700)]
ALSA: hda/realtek - set DMIC coefficients

The DMIC coefficients got lost upstream for ZGB between 3.0 and 3.2.
Without them the right channel is exactly the inverse of the left.
GTalk sums the two channels to get a mono stream, leading to zeros.  Use
the new chained fixup method to apply the needed coefficients.

BUG=chromium-os:29356
TEST="arecord -Dhw:1 -f cd /tmp/asdf.wav" copy file to host and use
audacity (or similar) to check that signals wouldn't add to zero.
GTalk call and ensure other party can hear you.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22440
(cherry picked from commit c6298255936f473e031c3dda0ff1719cf9b52784)

Change-Id: If2049ea42356f28fa93fa4021649460994b70a21
Reviewed-on: https://gerrit.chromium.org/gerrit/23165
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>

12 years agoCHROMIUM: tpm: don't run self test during probe
Luigi Semenzato [Mon, 21 May 2012 20:34:16 +0000 (13:34 -0700)]
CHROMIUM: tpm: don't run self test during probe

The new version of the tpm_tis driver in kernel 3.4 runs
TPM_ContinueSelfTest in the probe function.  This is bad
in two ways.  1. If the self test has completed (which it
most likely has, since it starts automatically at power on
and lasts about 500ms) then this may start a new instance
of the selftest, and waits for it to complete, thus
delaying boot.  2. With our TPM, the command fails with
error code 0xa (BAD_ORDINAL) for unfathomable reasons.

I have sent mail to the trousers mailing list (where the
author of the TPM driver lurks) requesting some help in
understanding what goes on.  But in the meanwhile we
should apply this patch and move on.

BUG=chromium-os:31065
TEST=booted, verified that TPM works (stop tcsd, tpmc test, start tcsd)

Change-Id: I23c1f3acb3dd1b2e3149553b07fb633ac27e4aeb
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23148
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
12 years agoHACK: tpm: export tpm_continue_selftest for tpm_tis_i2c
Olof Johansson [Thu, 17 May 2012 05:33:46 +0000 (22:33 -0700)]
HACK: tpm: export tpm_continue_selftest for tpm_tis_i2c

Some of the recent upstream changes broke tpm_tis_i2c. It should be fixed
properly, but until then this hack lets us keep moving.

BUG=none
TEST=make sure arm defconfigs build again. Not runtime tested at this
time.

Change-Id: I3bd9f5eb7a7406131e0782a8b33e2b85ed6792eb
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22906
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
12 years agoCHROMIUM: tpm: fix potential deadlock in resume_if_needed
Grant Grundler [Sat, 12 May 2012 00:16:27 +0000 (00:16 +0000)]
CHROMIUM: tpm: fix potential deadlock in resume_if_needed

Fixes potential deadlock in this call sequence:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> transmit_cmd

Sequence is now:
    transmit_cmd -> resume_if_needed -> tpm_continue_selftest -> tpm_transmit

Reorders declarations of transmit_cmd, tpm_continue_selftest, etc so
we don't need forward declarations of functions.

BUG=none
TEST=code review found the issue. No test.

Change-Id: I95aeb69e89faa2a6c6491350e49bd46ac44f06b1
Signed-off-by: Grant Grundler <grundler@chromium.org>
12 years agoCHROMIUM: scheduler: panic if schedulin while atomic
Sameer Nanda [Tue, 8 May 2012 23:07:31 +0000 (23:07 +0000)]
CHROMIUM: scheduler: panic if schedulin while atomic

When the schduling while atomic condition is hit, currently only a
printk and dump_stack happens but the kernel continues to run.  We've
run into issues where we think this causes a hang during shutdown
eventually.

Now doing a kernel panic instead by calling BUG().  This should prevent
hangs at shutdown from happening as well as providing us stack traces
that might help us root cause the real issue.

Signed-off-by: Sameer Nanda <snanda@chromium.org>
BUG=chromium-os:29599
TEST=We don't have a good way of repro'ing the hang on shutdown so the
testing is limited to kernel building fine.

Change-Id: I52084abf64a133a00f20e2eeaeb921820755e252
Reviewed-on: https://gerrit.chromium.org/gerrit/21534
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sameer Nanda <snanda@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.
Sam Leffler [Thu, 26 Apr 2012 23:54:35 +0000 (16:54 -0700)]
CHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.

Add a new clock type CLOCK_SYSTEM_TRACE to retrieve the current trace
clock value (if CONFIG_TRACING is not defined then CLOCK_SYSTEM_TRACE
returns the same value as CLOCK_MONOTONIC_RAW).  This allows user event
tracing to timestamp data with the same clock as the kernel.  This is
in-lieu of sending event data through trace_write (which is not a viable
option when there are lots of user-space events).

BUG=chromium-os:27809
TEST=manual:run test app to collect trace time and compare to data generated by the system (e.g. reading from trace)

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: If2167ed99291e05f8c298638f4118b10b3e710f8
Reviewed-on: https://gerrit.chromium.org/gerrit/21404
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
12 years agoALSA: hda/realtek - indicate jacks are black and on the left.
Dylan Reid [Thu, 12 Apr 2012 18:12:49 +0000 (11:12 -0700)]
ALSA: hda/realtek - indicate jacks are black and on the left.

This should be squashed with "24bb78aa23bb78aa - add a fixup for ACER's ZGB"
when rebased.  This change doesn't affect run time at all, just gets the color
and location right if you were to check /proc/asound/card0/codec#0.

BUG=none
TEST=build and run on ZGB, inspect /proc/asound/card0/codec#0

Change-Id: Iba5b9725d00e8676be7be02a5fae4ac92670c5cf
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/20170

12 years agoCHROMIUM: ALSA: hda/ca0132 - Move headphones to port D.
Dylan Reid [Thu, 12 Apr 2012 17:55:27 +0000 (10:55 -0700)]
CHROMIUM: ALSA: hda/ca0132 - Move headphones to port D.

For proto-1, HP are on PORTD not PORTA.  Turn on PORTD and configure
for HP output with a little magic from Creative.  This is a temporary
setup that we will use until we get a full driver from Creative.

BUG=chrome-os-partner:8911
TEST=manual, build and run, use amixer to adjust HP mute and volume.

Change-Id: I21bd67d7d122fa12ce472970c397972ed64e8b8c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/20169

12 years agoALSA: hda/realtek - add a fixup for ACER's ZGB.
Dylan Reid [Tue, 8 May 2012 18:08:15 +0000 (18:08 +0000)]
ALSA: hda/realtek - add a fixup for ACER's ZGB.

The ACER ZGB has SPDIF0 wired to an HDMI transmitter.  Configure the
pin widget for SPDIF0 to reflect that it is connected.

BUG=chromium-os:28564
TEST=manual, push kernel to ZGB, check that spdif control is there.
Attach HDMI TV an use aplay to test that audio is sent to the TV.

Change-Id: I6ff4ccae853758b53b584e06c7abc963289cb303
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19411
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: ALSA: hda: cirrus: Add a quirk for Stumpy.
Dylan Reid [Wed, 12 Oct 2011 07:07:16 +0000 (00:07 -0700)]
CHROMIUM: ALSA: hda: cirrus: Add a quirk for Stumpy.

Configure the codec when we are running on stumpy.
This is the same as for the Intel test board, but with new PCI
vendor/device ids.

Cherry pick from chromeos-3.0 commit d0aaf34dd22608df06f9657.

BUG=chrome-os-partner:6135
TEST=Manually plug and unplug various headsets with both the apple
and nokia pin outs.

Change-Id: I663b23bbbf3c8c65c1e2826436e1f4c204132438
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18635
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoALSA: hda: ca0132: set eapd
Dylan Reid [Tue, 28 Feb 2012 05:36:29 +0000 (21:36 -0800)]
ALSA: hda: ca0132: set eapd

Enable the EAPD pin and intialize it to power the amp.

Change-Id: I76b9766f332492f79810f73a1317a763a76e87d1
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18135
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: i2c: i801: enable irq for byte_by_byte transactions
Benson Leung [Tue, 8 May 2012 18:00:37 +0000 (18:00 +0000)]
CHROMIUM: i2c: i801: enable irq for byte_by_byte transactions

Byte-by-byte transactions are used primarily for accessing i2c devices
with an smbus controller.  For these transactions, for each byte that is
read or written, the SMBus controller generates a BYTE_DONE irq.  The isr
reads/writes the next byte, and clears the irq flag to start the next byte.
On the penultimate irq, the isr also sets the LAST_BYTE flag.

There is no locking around the cmd/len/count/data variables, since the
i2c adapter lock ensures there is never multiple simultaneous transactions
for the same device, and the driver thread never accesses these variables
while interrupts might be occurring.

The end result is a dramatic speed up in emulated i2c-over smbus block
read and write transactions.

Note: This patch has only been tested and verified by doing i2c read and
write block transfers on Cougar Point 6 Series PCH.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:24134
TEST=smbus cyapa (lumpy):
  1) is detected on both warm and cold boot.
  2) fw update takes ~15 seconds (was 95 sec)
  3) cyapa_fw_update -b -o /tmp/cyapa.bin takes ~20 sec (was 220 sec)

Reviewed-on: https://gerrit.chromium.org/gerrit/12815
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
(cherry picked from commit 66b2a28c01a633095b9f021ae5bc8f6c8941f1e3)

Change-Id: Id043296277b78e41b036f53e9b33c8a24244caf8
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18025
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: i2c: i801: enable irq for i801 smbus transactions
Benson Leung [Tue, 8 May 2012 17:28:01 +0000 (17:28 +0000)]
CHROMIUM: i2c: i801: enable irq for i801 smbus transactions

Add a new 'feature' to i2c-i801 to enable using i801 interrupts.
When the feature is enabled, then an isr is installed for the device's
pci irq.

An i2c/smbus transaction is always terminated by one of the following
interrupt sources: FAILED, BUS_ERR, DEV_ERR, or on success: INTR

When the isr fires for one of these cases, it sets the ->status variable
and wakes up the waitq.  The waitq then saves off the status code, and
clears ->status (in preperation for some future transaction).
The SMBus controller generates an INTR irq at the end of each
transaction where INTREN was set in the HST_CNT register.

No locking is needed around accesses to priv->status since all writes to
it are serialized: it is only ever set once in the isr at the end of a
transaction, and cleared while no irqs can occur.  In addition, the i2c
adapter lock guarantees that entire i2c transactions for a single
adapter are always serialized.

For this patch, the INTREN bit is set only for smbus block, byte and word
transactions, but not for emulated i2c reads or writes.  The use of the
DS (BYTE_DONE) interrupt with byte-by-byte i2c transactions is
implemented in a subsequent patch.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:24134
TEST=With interrupt feature disabled, no regression while accessing light
  sensor or cyapa trackpad, including during:
  * cold boot and warm boot
  * firmware update

Reviewed-on: https://gerrit.chromium.org/gerrit/12814
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
(cherry picked from commit 56873242fc098ae7890695795fa341f16be9f502)

Change-Id: I638aeebb3e02a4fc1f234ebaa8c46eece2129fc1
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/18024
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: ramoops: remove module parameters
Kees Cook [Mon, 9 Apr 2012 19:46:29 +0000 (19:46 +0000)]
CHROMIUM: ramoops: remove module parameters

The ramoops driver is intended to be used with platforms that define
persistent memory regions. If memory regions were configurable with
module parameters, it would be possible to read some RAM regions via
the new /proc interface without access to /dev/mem (which would
result in a loss of kernel memory privacy when a system is built with
STRICT_DEVMEM), so remove this ability completely.

BUG=chromium-os:12059
TEST=x86-alex build and boot, manually verified /dev/pstore/dmesg-ramoops-N
    showing breakme crash reports.

Change-Id: I5177af5b0a237b01633a9a202172504c8564c914
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11618

12 years agoCHROMIUM: ramoops: use pstore interface
Kees Cook [Mon, 9 Apr 2012 19:41:30 +0000 (19:41 +0000)]
CHROMIUM: ramoops: use pstore interface

Instead of using /dev/mem directly, use the common pstore infrastructure
to handle Oops gathering and extraction.

BUG=chromium-os:12059
TEST=x86-alex build and boot, manually verified /dev/pstore/dmesg-ramoops-N
    showing breakme crash reports.

Change-Id: Ice47506c005d56d24efa23d24bce1dbac0fbd571
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11617

12 years agoCHROMIUM: char: tpm: need to resume powered-off TPMs after resume
Olof Johansson [Fri, 9 Mar 2012 19:56:22 +0000 (11:56 -0800)]
CHROMIUM: char: tpm: need to resume powered-off TPMs after resume

I was looking at getting rid of some of our tpm patches, and this was
the remaining delta. I asked Luigi about it, and he said (in the below
referenced bug):

"The code that this patch removes is needed by devices that power off
the TPM during suspend.  I believe Alex and ZGB work that way, i.e. they
need the code that this patch removes.

If the platform maintains power to the TPM during suspend, then this
code isn't needed, i.e. you may apply the diff.  But since we're still
supporting Alex and ZGB, that code needs to be there."

So, adding it back without keeping the full add-removesome-addsome
history of the TPM drivers.

BUG=chromium-os:27576
TEST=regression suite

Change-Id: Idae59dcdf9fc66b14a522715824c9d227fdd375e
Signed-off-by: Olof Johansson <olofj@chromium.org>
12 years agoAdd radeon firmware to x86-generic kernels.
Stéphane Marchesin [Thu, 3 Nov 2011 00:59:09 +0000 (17:59 -0700)]
Add radeon firmware to x86-generic kernels.

BUG=chromium-os:21099
TEST=compiles

Change-Id: I2949a63aa94e9ae75c7fa7b2dce8fff0c17e26a6
Reviewed-on: https://gerrit.chromium.org/gerrit/17116
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

12 years agoCHROMIUM: exec: abort core dump piping only due to a fatal signal
Ben Chan [Thu, 1 Mar 2012 07:14:44 +0000 (23:14 -0800)]
CHROMIUM: exec: abort core dump piping only due to a fatal signal

This patch makes wait_for_dump_helpers() not to abort piping the core
dump data when the crashing process has received any but a fatal signal
(SIGKILL). The rationale is that a crashing process may still receive
uninteresting signals such as SIGCHLD when its core dump data is being
redirected to a helper application. While it's necessary to allow
terminating the core dump piping via SIGKILL, it's practically more
useful for the purpose of debugging and crash reporting if the core dump
piping is not aborted due to other non-fatal signals.

BUG=chromium-os:21559
TEST=Tested the following:
1. Modify /proc/sys/kernel/core_pattern to pipe core dump data to a
   modified crash reporter that waits for minutes before reading core
   dump data.
2. Run a program that crashes with SIGSEGV.
3. Send a SIGCHLD signal to the crashing process while its core dump
   data is being piped to the crash reporter. Verify that the core
   dump eventually finishes without being aborted.
4. Repeat 1-3 but send SIGKILL instead of SIGCHLD to the crashing
   process and verify that the core dump is aborted.

Change-Id: I71e52df0a936fd0f718a4bcb6777900032c0717d
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/17128
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
12 years agoCHERRY-PICK: drm/i915: Retry reading the PCH FDI receiver ISR
Sean Paul [Fri, 2 Mar 2012 17:53:39 +0000 (12:53 -0500)]
CHERRY-PICK: drm/i915: Retry reading the PCH FDI receiver ISR

According to the PRM (Vol3P2), the PCH FDI receiver ISR read for bit lock
should be retried at least once. This patch retries the read 5 times
with a small delay in between reads. I've had reports of display corruption
on resume with "FDI train 1 fail!", so I'm hoping that adding this retry
will mitigate the issue.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit fa37d39e4c6622d80bd8061d600701bcea1d6870)

BUG=chrome-os-partner:7439
TEST=Tested on lumpy with auto suspend/resume script

Change-Id: I8eb18050ddaadd91c5a2a06f4b664f5a3ea65c7f
Reviewed-on: https://gerrit.chromium.org/gerrit/17238
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Ready: Sean Paul <seanpaul@chromium.org>

12 years agoCHROMIUM: tpm_tis: move to bus 1 by default
Olof Johansson [Sun, 5 Feb 2012 03:56:08 +0000 (19:56 -0800)]
CHROMIUM: tpm_tis: move to bus 1 by default

Since the multiplexed bus on tegra has been disabled, this means that the
tpm is now on bus 1 by default.

This needs to be fixed with a properly configured driver at some point -- the device info shouldn't be in the driver.

BUG=none
TEST=boot a kaen with 3.2.

Change-Id: Ib7ed22917c9250ea0b0fbd0e4856e8c917367d30
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-on: https://gerrit.chromium.org/gerrit/15303
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>

12 years agoCHROMIUM: x86: don't print platform in show_regs
Olof Johansson [Thu, 5 Jan 2012 04:27:33 +0000 (20:27 -0800)]
CHROMIUM: x86: don't print platform in show_regs

We don't care what the platform is, and it's easier if it's just omitted.

BUG=none
TEST=none

Change-Id: I8f3685d36c86563ee6aa4b7f6f44975009720196
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-on: https://gerrit.chromium.org/gerrit/13696
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: tpm: tpm_tis_i2c: Lock the I2C adapter for a sequence of requests.
Bryan Freed [Tue, 2 Aug 2011 16:51:43 +0000 (09:51 -0700)]
CHROMIUM: tpm: tpm_tis_i2c: Lock the I2C adapter for a sequence of requests.

Submitted upstream at https://lkml.org/lkml/2011/8/3/327.
This is derived from Peter Huewe's hacked tpm_tis_i2c.c driver:

On some ChromeOS systems, a TPM sharing the I2C bus with another device
gets confused when it sees I2C requests to that other device.
This change locks the I2C adapter for the duration of the full sequence
of I2C requests the TPM needs to complete.

smbus_xfer is not supported, but SMBUS is not supported by the original
driver, either.

BUG=chrome-os-partner:4775
TEST='while tpmc getf > /dev/null; do echo -n .;done' runs a loooong time.

Change-Id: Ia9cb23aa5722e46aaebc1e96fb5bc3da2c134c7f
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5186
Reviewed-by: Grant Grundler <grundler@chromium.org>
12 years agochar/tpm_tis_i2c: minor bugfixes and cleanups
Peter Huewe [Mon, 4 Apr 2011 17:32:05 +0000 (10:32 -0700)]
char/tpm_tis_i2c: minor bugfixes and cleanups

This patchset consists of minor bugfixes and cleanups to the Infineon
IFX TPM TIS I2C Driver.
These patches were already sent to the TPM Maintainer who is currently
reviewing the driver.

The patchset consists of these patches:

char/tpm: Fix cleanup behavior if no hardware is attached in tpm_tis_i2c.c

This patch fixes the cleanup behavior if no hardware is attached, by fixing the
exit points.

Without this patch the driver fails to release the registered minor number if
no hardware is attached.
Moreover if the driver gets called 256 times without the hardware attached,
tpm_register_hardware runs out of device numbers and consequently fails and
tpm_remove_hardware gets called with a NULL pointer, leading to an OOPS.

char/tpm: spellcheck and version bump for tpm_tis_i2c.c

This patch fixes a small typo and bumps the version of tpm_tis_i2c.c to 2.1.1

char/tpm: workaround: TPM can't handle more than 0x4f9 bytes

If the TPM (beta firmware) receives more than 0x4f9 Bytes the TPM shuts itself
down. Since this is usually not the desired behavior the driver has to workaound
this bug by blocking any input over 0x4f9 (1273) bytes.
We chose 1260 as an (arbitrary) upper limit, just to be on the safe side.

char/tpm: don't bypass timeout mechanism for burstcount

If the tpm keeps on reporting burstcount == 0 the driver gets into an endless
loop. This patch fixes this by removing the bypass of the timeout mechanism for
burstcount.
If burstcount == 0 (for some time) the driver now returns gracefully with a
 -EBUSY.

char/tpm_tis_i2c: Update driver to proposed mainline version

This patch updates the tpm_tis_i2c.c driver to the version that was sent
to the LKML.

The patch fixes some spelling errors and bumps the version to 2.1.0
The patch is needed to apply the upcomming patches cleanly.

Change-Id: I95ca3ea90cc4976d3e4f5f19aa37d3f72e0703c2

BUG=
TEST=Running the trousers testsuite several times, manual tests, IFX LinuxDD testsuite
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/6794015

12 years agoCHROMIUM: char/tpm: Add support for Infineon's I2C TIS TPM
Peter Huewe [Fri, 11 Mar 2011 02:14:21 +0000 (18:14 -0800)]
CHROMIUM: char/tpm: Add support for Infineon's I2C TIS TPM

[Note: This driver will be reworked by the upstream TPM maintainer
to share as much code as possible with a couple of other i2c tpm's.
While that is taking place, we are checking in this driver to have
something to exercise hardware with. This will be reverted when
the upstream driver is available. -olofj]

This patch adds a new driver for Infineon's new I2C based TPM.
The used protocol is quite similar to the TCG TIS protocol.

Tested on: tegra2 seaboard (arm) , beagleboard (arm)
Known Bugs: Suspend does not work correctly on Seaboard, since I2C bus shuts
itself down too early. Works on Beagleboard

Change-Id: I7e945e2fb4edab4eded6c9cd92dd18a1e947c220

BUG=None
TEST= Running trousers testsuite several times, manual tests
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/6530003

12 years agoCHROMIUM:staging:iio:light: fix ISL29018 sensor operation after a brownout
Grant Grundler [Mon, 8 Aug 2011 16:45:08 +0000 (09:45 -0700)]
CHROMIUM:staging:iio:light: fix ISL29018 sensor operation after a brownout

After a voltage brownout, sensor will now operate correctly.

Page 10 of ISL29018 data sheet and the Intersil Application Note 1534
describe the required initialization sequence:
1. Write 0x00 to register 0x08 (TEST)
2. Write 0x00 to register 0x00 (CMD1)
3. msleep(1)
4. program remaining registers as before

BUG=chrome-os-partner:5351,chrome-os-partner:4752
TEST=manual (boots and light sensor responds after 5 seconds)

Change-Id: I09738e3680cacfa9f71e2173cdd02aae82e26dd5
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5474
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
12 years agoCHROMIUM: Firmware: Add AMD fusion firmware.
Stéphane Marchesin [Mon, 13 Jun 2011 21:46:13 +0000 (14:46 -0700)]
CHROMIUM: Firmware: Add AMD fusion firmware.

Change-Id: Id16d3535c5170580dbdab13735257b8e6d6f5864
Reviewed-on: http://gerrit.chromium.org/gerrit/2565
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: firmware: import amd fusion gpu firmware
Stéphane Marchesin [Mon, 6 Jun 2011 21:05:38 +0000 (14:05 -0700)]
CHROMIUM: firmware: import amd fusion gpu firmware

Change-Id: I361bd061b4dc28aa33012010ccf9ecbe0e5c0c8a
Reviewed-on: http://gerrit.chromium.org/gerrit/2175
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
12 years agoMOBLIN: fastboot: remove "wait for all devices before mounting root" delay
Arjan van de Ven [Sun, 20 Jul 2008 20:12:16 +0000 (13:12 -0700)]
MOBLIN: fastboot: remove "wait for all devices before mounting root" delay

In the non-initrd case, we wait for all devices to finish their
probing before we try to mount the rootfs.
In practice, this means that we end up waiting 2 extra seconds for
the PS/2 mouse probing even though the root holding device has been
ready since a long time.

The previous two patches in this series made the RAID autodetect code
do it's own "wait for probing to be done" code, and added
"wait and retry" functionality in case the root device isn't actually
available.

These two changes should make it safe to remove the delay itself,
and this patch does this. On my test laptop, this reduces the boot time
by 2 seconds (kernel time goes from 3.9 to 1.9 seconds).

Change-Id: Ie32e9d5f93b35b1aed0d955e8e472b9fc73227e4
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1667
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: drm/i915/intel_i2c: Allow 400khz for cyapa
Benson Leung [Thu, 17 May 2012 22:07:27 +0000 (15:07 -0700)]
CHROMIUM: drm/i915/intel_i2c: Allow 400khz for cyapa

Allow 400khz mode on port2, VGADDC address 0x67 for
cyapa i2c touchpads. This will improve firmware
update speed.

BUG=chrome-os-partner:9798
TEST=time echo 1 > /sys/bus/i2c/devices/2-0067/update_fw
Check that the update firmware succeeds, and the time
taken was:
real 0m13.823s
user 0m0.000s
sys 0m0.121s

Change-Id: I38afaef60f1421003a1e54f4108f465ba4ce7899
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/22990
Reviewed-by: Yufeng Shen <miletus@chromium.org>
12 years agoCHROMIUM: drm/i915/intel_i2c: enable 400kHz GMBUS for atmel_mxt devices
Daniel Kurtz [Tue, 15 May 2012 18:14:16 +0000 (11:14 -0700)]
CHROMIUM: drm/i915/intel_i2c: enable 400kHz GMBUS for atmel_mxt devices

i915 gmbus writes at 400kHz should now work properly.

So, enable 400kHz and the native gmbus algorithm by default, but limit
to known high speed devices:
  * atmel_mxt devices on vga ddc
  * atmel_mxt devices (app mode and bootloader) on panel ddc

After further testing, this can be enabled for all devices and ddc
adapters.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:26118,chrome-os-partner:8547,chrome-os-partner:8732
TEST=compiles clean; i915 driver successfully communicates to i2c devices
  on the vga and panel ddc adapters.
  Tested using an atmel i2c touchpad and atmel_mxt_ts driver.
TEST=place valid atmel mxt firmware at /lib/firmware/maxtouch.fw
  time echo 1 > update_fw
  Check that firmware update succeeds, and that the time is less than 18s.
  time echo 1 > update_fw

  real 0m17.923s
  user 0m0.000s
  sys 0m0.188s

This is a squash of three commits onto v3.4-rc5+danvet/intel-drm-next:

Change-Id: Id911a732409b06a4b0a654270d548929e2887582
Reviewed-on: https://gerrit.chromium.org/gerrit/17938

Change-Id: Ide237fbe6c33b17395d8398af1b691db69eb3036
Reviewed-on: https://gerrit.chromium.org/gerrit/18425

Change-Id: Ic5741b98b30c522acd3bee0a92041e08993e950e
Reviewed-on: https://gerrit.chromium.org/gerrit/21833

12 years agoCHROMIUM: drm/i915/intel_drv: reduce wait_for polling time
Daniel Kurtz [Tue, 8 May 2012 00:32:41 +0000 (00:32 +0000)]
CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time

Currently, 400kHz i2c transactions on i915 ddc adapters are gated by
long polling loops in the wait_for() macro.
For the case where the polling loops sleep, make them tighter by
converting a msleep(1) to usleep_range(50, 100);

A better solution might be to eliminate this polling entirely, and use
the i915 interrupts to detect state transitions instead of polling.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:26118
TEST=i2c reads over ddc succeed.  On a scope, single transactions no
  longer have large gaps.

Change-Id: I96cef50ed8a3d0ad8a3c6fa6f079234242fa17d3
Reviewed-on: https://gerrit.chromium.org/gerrit/17937
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>