mmc: core: Set read only for SD cards with permanent write protect bit
authorSeunghui Lee <sh043.lee@samsung.com>
Mon, 22 Feb 2021 08:31:56 +0000 (17:31 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 30 Mar 2021 09:41:59 +0000 (11:41 +0200)
commit917a5336f2c27928be270226ab374ed0cbf3805d
tree98f0e316601117cf1aafb4a63fd6e6342e90f091
parente29c84857e2d51aa017ce04284b962742fb97d9e
mmc: core: Set read only for SD cards with permanent write protect bit

Some of SD cards sets permanent write protection bit in their CSD register,
due to lifespan or internal problem. To avoid unnecessary I/O write
operations, let's parse the bits in the CSD during initialization and mark
the card as read only for this case.

Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
Link: https://lore.kernel.org/r/20210222083156.19158-1-sh043.lee@samsung.com
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/sd.c