From: "Al Cooper" <alcooperx@gmail.com>
To: cjb@laptop.org, linux-mmc@vger.kernel.org
Cc: Al Cooper <acooper@broadcom.com>
Subject: [PATCH 6/7] mmc: lock: Prevent partition table read for locked cards.
Date: Tue, 13 Aug 2013 11:21:29 -0400 [thread overview]
Message-ID: <1376407290-21477-7-git-send-email-alcooperx@gmail.com> (raw)
In-Reply-To: <1376407290-21477-1-git-send-email-alcooperx@gmail.com>
From: Al Cooper <acooper@broadcom.com>
Change the MMC block layer to avoid reading the partition table
when the card is locked because read commands will fail.
refs #SWLINUX-2545
Signed-off-by: Al Cooper <acooper@broadcom.com>
---
drivers/mmc/card/block.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index cd0b7f4..8eb254f 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2047,6 +2047,13 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
md->disk->flags |= GENHD_FL_NO_PART_SCAN;
/*
+ * If the card is locked, reads will fail so prevent partition
+ * table scan
+ */
+ if (mmc_card_locked(card))
+ md->disk->flags |= GENHD_FL_NO_PART_SCAN;
+
+ /*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
*
* - be set for removable media with permanent block devices
--
1.8.1.3
next prev parent reply other threads:[~2013-08-13 15:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 15:21 [PATCH 0/7] Add password protected lock/unlock support for SD/MMC Al Cooper
2013-08-13 15:21 ` [PATCH 1/7] mmc: lock: Use the kernel "KEYS" subsystem to get a card's password Al Cooper
2013-08-15 1:16 ` Brian Norris
2013-08-23 10:34 ` Ulf Hansson
2013-08-13 15:21 ` [PATCH 2/7] mmc: lock: Add low level LOCK_UNLOCK command Al Cooper
2013-08-13 15:21 ` [PATCH 3/7] mmc: lock: Add funtion to unlock a password locked card Al Cooper
2013-08-13 15:21 ` [PATCH 4/7] mmc: lock: Add card lock/unlock maintenance commands Al Cooper
2013-08-13 15:21 ` [PATCH 5/7] mmc: lock: Change SD init functionality to handle locked SD cards Al Cooper
2013-08-13 15:21 ` Al Cooper [this message]
2013-08-13 15:21 ` [PATCH 7/7] mmc: lock: Change MMC init to handle locked cards Al Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376407290-21477-7-git-send-email-alcooperx@gmail.com \
--to=alcooperx@gmail.com \
--cc=acooper@broadcom.com \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).