mmc: core: Fix CQ runtime suspend

Fix the timeout issue with mmc_cmdq_halt() that happens in the
below scenario -

1. Let us say an RPMB request is processed just before the
runtime suspend. The RPMB request will put the controller in HALT
state and will put the card in legacy mode.

2. So during runtime suspend, the SW will check for card's state and
since it is in legacy mode, it won't call CQ disable host->op.
But CQ HW will get reset due to SW reset that gets issued during suspend.

3. If we get another RPMB request, we try to do the runtime resume.
But since SW did not invoke CQ disable host->op, it thinks that CQ is still
enabled and returns here without enabling CQ.

4. Now the RPMB request tries to put the controller in HALT state but
timesout since CQ is still not enabled.

Fix this issue by checking for host->card->cmdq_init to determine
if the controller is initialized in CQ mode instead of checking for
card's state in runtime suspend. This will ensure CQ will be disabled
as part of runtime suspend and will be enabled again during
runtime resume.

Change-Id: I26bf97962d31522a9cb25009c6a048dfff6e4535
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
1 file changed