drivers: Squashed revert of APANIC/SDCC RAW changes.

Revert "mmc: sdcc_raw: Properly enable/disable clocks."

This reverts commit 3da6c0534189cb65f199985bc2d4e1f2b887bdb8.

Revert "mmc: sdcc_raw: Add 7x30 support."

This reverts commit 43f16e2fc91ee433ae0bfcb320c019d7d1c53c46.

Revert "apanic_mmc: Fix compilation errors."

This reverts commit 8546f09db7818699225e07fa5707d892cfa6b047.

Revert "apanic_mmc: Compare the device name of partition instead of partition name."

This reverts commit 6b3856bc34b51207d2de0e792cdcec06f31f28c2.

Revert "Import APANIC MMC & SDCC RAW drivers."

This reverts commit 721fb605dd08420b055e6507688209f34fc71d40.
Revert "u8800: Add & Enable APANIC MMC driver."

This reverts commit 6d5085ba82cf6fda99903932316da9883fa860a1.

Conflicts:
	arch/arm/configs/u8800_defconfig

Change-Id: Idd18fd8d383aa1ecfd80dde455a92809e8ab7709
mmc:host: add raw mode msm8960 driver

It's required by apanic_mmc.

It's ported based on following changes from msm8x55 project:

  * (CR) - Porting apanic_mmc driver to dump
    kernel panic log
    http://gerrit.pcs.mot.com/50941

  * (CR) Pax: Apanic driver can't caputre log when
    panic happens at irq context.
    http://gerrit.pcs.mot.com/216902

  * (CR) Pax: Capture more apanic_threads logs without
    enlarge kernel log buffer.
    http://gerrit.pcs.mot.com/236954

  * (CR) Pax:Fix kernel apanic_thread log issue.
    http://gerrit.pcs.mot.com/262653

Addtional changes include 1) add postcore_initcall();
2) fix warning by replacing clk_enable/clk_disable with
clk_prepare_enable/clk_disable_unprepare.

Change-Id: I84ab9ff9b648178cf1bb58b96230107a8fa4a792
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/503406
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: David Ding <dding@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
drivers: apanic_mmc: write panic information to raw MMC partition

This patch is created based on the following changes:

* (CR) apanic_mmc: support writing panic data to
  raw MMC partition
  Reviewed-on: http://gerrit.pcs.mot.com/342283

* (CR): fix no apanic_threads issue
  Reviewed-on: http://gerrit.pcs.mot.com/377655

* (CR) Porting omap split apanic_threads to qcom
  Reviewed-on: http://gerrit.pcs.mot.com/377659

* (CR): Support apanic dump ftrace buffer no
  more than 512k
  Reviewed-on: http://gerrit.pcs.mot.com/377664

* (CR): port apanic annotations from AP20
  Reviewed-on: http://gerrit.pcs.mot.com/392744

* (CR): apanic: add read support to user space
  annotations
  Reviewed-on: http://gerrit.pcs.mot.com/400182

* (CR) Fix potential watchdog reset on emmc kernel
  panic failure for qcom platform.
  Reviewed-on: http://gerrit.pcs.mot.com/404849

Change-Id: Ice455ee53448f05d6d252ab4378963d1cbd01443
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/503768
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
(cherry picked from commit eeef74de0ec7a7cc77455eee84acdbf693edf344)
Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
drivers: apanic_mmc: del touch_hw_watchdog() definition

Change-Id: I0f3b4316cf3bf466cbfd9e6d4423039c407400bc
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/505635
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit 2044518b45aa5405ea1f89af077452ee8f99a07b)
drivers:apanic_mmc: enable hw watchdog before writing log

Panic may happen without HW watchdog enabled (e.g. in suspend/resume path).
In case apanic_mmc hang somewhere, phone will be deadly blocked.

This patch is to enable HW watchdog before writing panic logs to emmc.

Change-Id: I611eebf1d0344fc953631c3711e5550564ff620e
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/619255
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Hong-Mei Li <a21834@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: apanic_mmc: Add kpan partition only once

Currently, apanic_mmc_partition_add would be invoked whenever there is uevent
on mmcblk device. This would result in dead lock when rescan_partitions ioctl
is called.

The solution is to read panic data from mmc partition only one time for every
boot up.

Change-Id: I29abd2e5b9d61898e142b0020a63f92631c89ce2
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/556883
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Qing Chang <a21550@motorola.com>
Reviewed-by: Christopher Fries <c.fries@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
SLT-Approved: Sanjay Dhar <csd004@motorola.com>
mmc: host: sdcc_raw: port raw mmc driver to msm8226

The changes include:
1. Not reference to msm_device_sdc1
2. Change SDC1 base for 8226

Change-Id: Ife98cdb229dfe32e5afbf7a0ef5fbde702b64eb7
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Change-Id: Icc673c2583fa3f436b620965b8b33406ce99372a
Reviewed-on: http://gerrit.pcs.mot.com/539505
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: host: Add retry mechanism for status read

Sometimes there is delay to set fifo full bit in mci status register after
write data into fifo. that could cause write full fifo error in mci status2
register then cause raw_mmc_write_to_card cannot exit the first do-while loop.
This change add some delays to wait for fifo full bit to be stablized in mci
status register.

Signed-off-by: Sheng-Zhe Zhao <a18689@motorola.com>
Change-Id: I2b8762f7a8294273e7364df79bbc1f5382906ddb
Reviewed-on: http://gerrit.pcs.mot.com/554084
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: raw: short delay time for fifo full bit to be stable

The delay time previously used is too long that could cause too long
writing time for panic log, here short it. also add more codes to avoid
WDT.

Signed-off-by: Sheng-Zhe Zhao <a18689@motorola.com>
Change-Id: Icdfd27a03e9b93496747275409eb663024a4b8c4
Reviewed-on: http://gerrit.pcs.mot.com/555587
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: raw: disable sdhci mode for sdcc raw driver

If bootloader/kernel enabled sdhci mode, in kernel msm sdcc raw driver,
need to disable it to avoid the malfunction of sdcc raw driver.

Change-Id: I19e58f96160aea1a1998bb170f28a4e9711cf142
Signed-off-by: Sheng-Zhe Zhao <a18689@motorola.com>
Change-Id: I8f2ea466de309f933e6bd7e75258f5e9687f7800
Reviewed-on: http://gerrit.pcs.mot.com/565450
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: raw: clean HC_MODE_EN before MMC host power cycle

Clean the HC_MODE_EN before MMC host power cycle, otherwise kernel might
stuck at power mode changing on 8974.

And add delay to wait for the mmc command to be send to mmc card. Without
the delay, random response might be returned on 8974.

Tested the changes on 8x10, 8x26 and 8974.

Change-Id: I3774cbb4b2fc2ae2e31b9edec1d7a8367de9b0fa
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/604807
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Sheng-Zhe Zhao <a18689@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
block: partition: apanic_mmc hook

apanic_mmc needs to identify its own partition and finish its
initialization as early as possible; so that, it can catch
the panic in early system init stage.

It's ported from the following patch:

* (CR) apanic_mmc: support writing panic data to
  raw MMC partition
  Reviewed-on: http://gerrit.pcs.mot.com/342283

Although it's not an ideal solution, it's the best we have.

Change-Id: I5425d0ae4ac8ac25bcfa9b27ba1b38b3c0e23f29
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/503913
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
(cherry picked from commit 7a4508c1c18497e57524931509133d61efce5fb1)
mmc: raw: Add support for all SDCC devices.

Change-Id: I8ad7d379747462b1d8e49027aae92fd649454a2d
mmc: raw: Add 7x30 support.

Change-Id: I87b4b587af632e9025311165607eac836db4674a
mmc: raw: Free clock after requesting it.

Change-Id: I0d684645ba26fd6637a5793ac1c2b496b68133ad
apanic_mmc: Compare the device name of partition instead of partition name.

Allows devices without partition names to enable apanic.

Change-Id: I51ad1932bb68fd2ef9833b55c66cc9ce9335c3a4
apanic_mmc: Remove HW watchdog.

Change-Id: I7ff8666b53b812b4f40a0b2bea65853c764c0ebe
trace: add a interface and change default buf size

Add a new interface : tracing_get_trace_buf_size(); and change the
default buffer size to 256KB.

This change is requested by apanic_mmc.

It's part of the following patch:

* (CR): Support apanic dump ftrace buffer no more than 512k
  Reviewed-on: http://gerrit.pcs.mot.com/377664

Change-Id: Ie125f7cbc27b7636e173465997db463248a081fb
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/503767
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit 5dbfb3dbc31ae3f1e132271a2db5f170cc4e27f8)
sched: add show_state_thread_filter()

Add the new function show_state_thread_filter() which
can indicate whether kernel or user-space threads'
state should be shown.

This change is requested by apanic_mmc.

It's part of the following patch:

* (CR) Porting omap split apanic_threads to qcom
  Reviewed-on: http://gerrit.pcs.mot.com/377659

Change-Id: I0dd722a6d983195fa7f7b821e61c2a7f06d2cb99
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/503766
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit 30e2a56cc3d8b62c2a83f7984faebc560bb8c0af)