scsi: ufs: add support to double check the presence of UFS card
When UFS card is removed, as the extcon gpio has a debounce delay, the
state of the card is not updated simultaneously. If the presence of
UFS card is critical to decide if errors are caused by card removal in some
paths, such as error handler path, it would be not enough just check its
state. This change adds one func to check the presence of the UFS card. If
the state of the card is offline, then return false. If the state says
online then sleep 300ms, which is longer than the extcon gpio debounce
delay, then check the state again, if state is changed, it means the card
is removed.
Change-Id: I246d7444497793f55999bb9618612ade40bd36b5
Signed-off-by:
Can Guo <cang@codeaurora.org>
Loading
Please register or sign in to comment