diff options
| author | Asutosh Das <asutoshd@codeaurora.org> | 2016-04-21 14:15:15 +0530 |
|---|---|---|
| committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-13 19:06:20 -0700 |
| commit | 20e43d0532e9cedb5961f8d4ff848b20cdfeb418 (patch) | |
| tree | 678bb27c23cca80231dd907a9928e4e3e08f71d7 /drivers | |
| parent | 240bee3ffdb7f00da3e2b626e3521869581fc52d (diff) | |
mmc: core: fix reading the bkops status from card
The bkops status is indicated by the bit 0 and 1 of the
246th byte of the ext_csd register.
The current code doesn't ignore the rest of the byte.
Fix this by extracting the bit 0 and 1 only
for the current bkops urgency.
The exception level is defined by the least significant
nibble of 54th byte in the ext_csd register. The current
code doesn't ignore the rest of the byte.
Fix this by extracting the nibble(LSB) for exception status.
Change-Id: Ic90fe26a676ae7dd2063e17bc3771db83605f4dc
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mmc/core/core.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 2197e2495b88..add448035213 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1871,8 +1871,14 @@ int mmc_read_bkops_status(struct mmc_card *card) if (err) return err; - card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS]; - card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS]; + card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS] & + MMC_BKOPS_URGENCY_MASK; + card->ext_csd.raw_exception_status = + ext_csd[EXT_CSD_EXP_EVENTS_STATUS] & (EXT_CSD_URGENT_BKOPS | + EXT_CSD_DYNCAP_NEEDED | + EXT_CSD_SYSPOOL_EXHAUSTED + | EXT_CSD_PACKED_FAILURE); + kfree(ext_csd); return 0; } |
