mmc: core: remove the polling for BKOPS completion

The original intention of polling for BKOPS completion was to give
the card enough time to perform the BKOPS before it is runtime suspended.
But as the BKOPS completion polling was happening in a different
context, it may race with card runtime/platform suspend which is quite
difficult to fix. So instead of BKOPS polling, let the runtime suspend
get deferred if the BKOPS is running on the card. Also if BKOPS is running
when platform suspend is triggered, stop the BKOPS before suspending the
card.

CRs-Fixed: 489523

Change-Id: Ib95c45ba2556b30d706f8d393f6f21fcc20e23f3
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: core: expose HPI capability to SWITCH commands

Some of the time consuming operations such as BKOPS, SANITIZE, CACHE
flush/off use the SWITCH command (CMD6) but as these operations don't
have card specification defined timeout for completion, we may see
timeout errors if card doesn't complete the operation within the SW
defined timeout. If SW defined timeout is hit, above operations are
considered to be failed and no real recovery mechanism is implemented
after timeout.

Most of the above operations (BKOPS/SANITIZE/CACHE flush/off) can be
interrupted by sending the HPI (High Priority Interrupt) command to card
if they taking longer than expected. This change adds the base support
which will these operations to be HPIed after timeout.

Change-Id: I67e889e94df1aa4f06a7e4030c97d543dfff7307
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
mmc: msm_sdcc: change the bkops_busy flag check to ignore_timeout

MMC core layer have made the "bkops_busy" flag in the mmc_command
structure absolute, use "ignore_timeout" instead.

Change-Id: I340aeb3193b43aa32034a3583e15be8261207525
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
mmc: core: remove bkops_busy flag from the mmc_command structure

As "bkops_busy" flag is no longer used, remove it from the mmc_command
structure.

Change-Id: I739030e90d37ce40a484a072e604a0e398b2872e
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
mmc: core: handle flush requests timeout

According to the eMMC 4.5 spec "Flushing a large amount of cached data may
take very unpredictably long time". Therefore the timeout for FLUSH should
be increased to prevent timeouts.

In case the timeout occurs HPI issued.

CRs-Fixed: 500874

Change-Id: I7a9195056481e6a8756c2c804ee20739bd461734
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
msm: board-8930-gpiomux: Change gpio config mode

Modify functional mode of suspended GPIO configuration
of GSBI9 to GPIO mode instead of FUNC2 mode. Observed
current leakage issue during bootup when the functional
mode of the GPIO is FUNC2. Hence, it is changed to
GPIO mode in this patch.

Change-Id: I35341c0530b571db955ec9b8c63ffd060f0ffd02
CRs-Fixed: 534685
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Merge "msm: board-8930-gpiomux: Change gpio config mode"
Merge "mmc: core: remove the polling for BKOPS completion"
Merge "mmc: core: expose HPI capability to SWITCH commands"
Merge "mmc: msm_sdcc: change the bkops_busy flag check to ignore_timeout"
Merge "mmc: core: remove bkops_busy flag from the mmc_command structure"
Merge "mmc: core: handle flush requests timeout"