mmc: sdhci-pci: Fix card detect race for Intel BXT/APL
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 9 Feb 2016 14:12:37 +0000 (16:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:16 +0000 (15:07 -0800)
commitdfca191876436fd33c6ad18258116a2bf5506618
tree9ec06f8682f9d1798db2e6e81d54b3a10eb60ddf
parentb7f7a5e2e914e9f5332ea56d10e0db4be3363375
mmc: sdhci-pci: Fix card detect race for Intel BXT/APL

commit 163cbe31e5163459908a41a2b4e0d33a28fd557a upstream.

Intel BXT/APL use a card detect GPIO however the host controller
will not enable bus power unless it's card detect also reflects
the presence of a card.  Unfortunately those 2 things race which
can result in commands not starting, after which the controller
does nothing and there is a 10 second wait for the driver's
10-second timer to timeout.

That is fixed by having the driver look also at the present state
register to determine if the card is present.  Consequently, provide
a 'get_cd' mmc host operation for BXT/APL that does that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/sdhci-pci-core.c