linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: card: Skip secure option for MoviNAND.
@ 2012-08-13  9:50 IAN CHEN
  2012-08-13 13:02 ` Namjae Jeon
  2012-08-13 13:39 ` Linus Walleij
  0 siblings, 2 replies; 7+ messages in thread
From: IAN CHEN @ 2012-08-13  9:50 UTC (permalink / raw)
  To: cjb, linkinjeon, adrian.hunter, subhashj, linus.walleij,
	linux-mmc, linux-kernel
  Cc: d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung, ian.cy.chen

>From 5c60eb8be04c7440d6e33b8f72ea2046a3657ac4 Mon Sep 17 00:00:00 2001
From: ian.cy.chen <ian.cy.chen@samsung.com>
Date: Mon, 13 Aug 2012 10:53:55 +0900
Subject: [PATCH] mmc: card: Skip secure option for MoviNAND.

For several MoviNAND, there are some known issue with secure option.
For these specific MoviNAND device, we skip secure option.

Signed-off-by: Ian Chen <ian.cy.chen@samsung.com>
---
 drivers/mmc/card/block.c |   24 +++++++++++++++++++++++-
 include/linux/mmc/card.h |    1 +
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index f1c84de..9f47dbf 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1411,7 +1411,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq,
struct request *req)
         /* complete ongoing async transfer before issuing discard */
         if (card->host->areq)
             mmc_blk_issue_rw_rq(mq, NULL);
-        if (req->cmd_flags & REQ_SECURE)
+        if (req->cmd_flags & REQ_SECURE &&
+            !(card->quirks & MMC_QUIRK_MOVINAND_SECURE))
             ret = mmc_blk_issue_secdiscard_rq(mq, req);
         else
             ret = mmc_blk_issue_discard_rq(mq, req);
@@ -1716,6 +1717,7 @@ force_ro_fail:
 #define CID_MANFID_SANDISK    0x2
 #define CID_MANFID_TOSHIBA    0x11
 #define CID_MANFID_MICRON    0x13
+#define CID_MANFID_SAMSUNG    0x15
 
 static const struct mmc_fixup blk_fixups[] =
 {
@@ -1752,6 +1754,26 @@ static const struct mmc_fixup blk_fixups[] =
     MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc,
           MMC_QUIRK_LONG_READ_TIME),
 
+    /*
+     * Some issue about secure erase/secure trim for Samsung MoviNAND
+     */
+    MMC_FIXUP("M8G2FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("MAG4FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("MBG8FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("MCGAFA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("VAL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("VYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("KYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+    MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
+          MMC_QUIRK_MOVINAND_SECURE),
+
     END_FIXUP
 };
 
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 111aca5..4505a30 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -239,6 +239,7 @@ struct mmc_card {
 #define MMC_QUIRK_BLK_NO_CMD23    (1<<7)        /* Avoid CMD23 for
regular multiblock */
 #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8)    /* Avoid sending 512
bytes in */
 #define MMC_QUIRK_LONG_READ_TIME (1<<9)        /* Data read time > CSD
says */
+#define MMC_QUIRK_MOVINAND_SECURE (1<<10)    /* MoviNAND secure issue */
                         /* byte mode */
     unsigned int    poweroff_notify_state;    /* eMMC4.5 notify feature */
 #define MMC_NO_POWER_NOTIFICATION    0
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-13  9:50 [PATCH] mmc: card: Skip secure option for MoviNAND IAN CHEN
@ 2012-08-13 13:02 ` Namjae Jeon
  2012-08-14  2:10   ` IAN CHEN
  2012-08-14  2:12   ` IAN CHEN
  2012-08-13 13:39 ` Linus Walleij
  1 sibling, 2 replies; 7+ messages in thread
From: Namjae Jeon @ 2012-08-13 13:02 UTC (permalink / raw)
  To: IAN CHEN
  Cc: cjb, adrian.hunter, subhashj, linus.walleij, linux-mmc,
	linux-kernel, d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

Hi. Ian.

known issue ? Would you explain more ?

Thanks.

2012/8/13 IAN CHEN <ian.cy.chen@samsung.com>:
> From 5c60eb8be04c7440d6e33b8f72ea2046a3657ac4 Mon Sep 17 00:00:00 2001
> From: ian.cy.chen <ian.cy.chen@samsung.com>
> Date: Mon, 13 Aug 2012 10:53:55 +0900
> Subject: [PATCH] mmc: card: Skip secure option for MoviNAND.
>
> For several MoviNAND, there are some known issue with secure option.
> For these specific MoviNAND device, we skip secure option.
>
> Signed-off-by: Ian Chen <ian.cy.chen@samsung.com>
> ---
>  drivers/mmc/card/block.c |   24 +++++++++++++++++++++++-
>  include/linux/mmc/card.h |    1 +
>  2 files changed, 24 insertions(+), 1 deletions(-)
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-13  9:50 [PATCH] mmc: card: Skip secure option for MoviNAND IAN CHEN
  2012-08-13 13:02 ` Namjae Jeon
@ 2012-08-13 13:39 ` Linus Walleij
  1 sibling, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-08-13 13:39 UTC (permalink / raw)
  To: IAN CHEN
  Cc: cjb, linkinjeon, adrian.hunter, subhashj, linux-mmc,
	linux-kernel, d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

On Mon, Aug 13, 2012 at 11:50 AM, IAN CHEN <ian.cy.chen@samsung.com> wrote:

> For several MoviNAND, there are some known issue with secure option.
> For these specific MoviNAND device, we skip secure option.

OK..

> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index 111aca5..4505a30 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -239,6 +239,7 @@ struct mmc_card {
>  #define MMC_QUIRK_BLK_NO_CMD23    (1<<7)        /* Avoid CMD23 for
> regular multiblock */
>  #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8)    /* Avoid sending 512
> bytes in */
>  #define MMC_QUIRK_LONG_READ_TIME (1<<9)        /* Data read time > CSD
> says */
> +#define MMC_QUIRK_MOVINAND_SECURE (1<<10)    /* MoviNAND secure issue */
>                          /* byte mode */
>      unsigned int    poweroff_notify_state;    /* eMMC4.5 notify feature */
>  #define MMC_NO_POWER_NOTIFICATION    0

So if there is a FOO memory with broken secure features I will have to add
MMC_QUIRK_FOO_SECURE  etc?

No thanks, name the flag something netral that can be reused, like
MMC_QUIRK_SECURE_MODE_BROKEN, simply.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-13 13:02 ` Namjae Jeon
@ 2012-08-14  2:10   ` IAN CHEN
  2012-08-14  2:12   ` IAN CHEN
  1 sibling, 0 replies; 7+ messages in thread
From: IAN CHEN @ 2012-08-14  2:10 UTC (permalink / raw)
  To: 'Namjae Jeon'
  Cc: cjb, adrian.hunter, subhashj, linus.walleij, linux-mmc,
	linux-kernel, d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

Dear Mr. Jeon,

This is workaround for some Samsung eMMC, MoviNAND.
There are known issue about secure erase & secure trim with these eMMC device which I listed by product_name.
Therefore, for these eMMC devices, we just skip mmc_blk_issue_secdiscard_rq() and use mmc_blk_issue_discard_rq() instead.

You could refer this discussion in XDA developers.
    http://forum.xda-developers.com/showthread.php?t=1644364
    https://plus.google.com/111398485184813224730/posts/21pTYfTsCkB#111398485184813224730/posts/21pTYfTsCkB

Regards,
Ian
 
-----Original Message-----
From: Namjae Jeon [mailto:linkinjeon@gmail.com] 
Sent: Monday, August 13, 2012 10:03 PM
To: IAN CHEN
Cc: cjb@laptop.org; adrian.hunter@intel.com; subhashj@codeaurora.org; linus.walleij@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org; d.j.shin@samsung.com; jongtae22.kim@samsung.com; kyungmin.park@samsung.com; jh80.chung@samsung.com
Subject: Re: [PATCH] mmc: card: Skip secure option for MoviNAND.

Hi. Ian.

known issue ? Would you explain more ?

Thanks.

2012/8/13 IAN CHEN <ian.cy.chen@samsung.com>:
> From 5c60eb8be04c7440d6e33b8f72ea2046a3657ac4 Mon Sep 17 00:00:00 2001
> From: ian.cy.chen <ian.cy.chen@samsung.com>
> Date: Mon, 13 Aug 2012 10:53:55 +0900
> Subject: [PATCH] mmc: card: Skip secure option for MoviNAND.
>
> For several MoviNAND, there are some known issue with secure option.
> For these specific MoviNAND device, we skip secure option.
>
> Signed-off-by: Ian Chen <ian.cy.chen@samsung.com>
> ---
>  drivers/mmc/card/block.c |   24 +++++++++++++++++++++++-
>  include/linux/mmc/card.h |    1 +
>  2 files changed, 24 insertions(+), 1 deletions(-)
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-13 13:02 ` Namjae Jeon
  2012-08-14  2:10   ` IAN CHEN
@ 2012-08-14  2:12   ` IAN CHEN
  2012-08-14  3:51     ` Namjae Jeon
  1 sibling, 1 reply; 7+ messages in thread
From: IAN CHEN @ 2012-08-14  2:12 UTC (permalink / raw)
  To: 'Namjae Jeon'
  Cc: cjb, adrian.hunter, subhashj, linus.walleij, linux-mmc,
	linux-kernel, d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

Dear Mr. Jeon,

This is workaround for some Samsung eMMC, MoviNAND.
There are known issue about secure erase & secure trim with these eMMC device which I listed by product_name.
Therefore, for these eMMC devices, we just skip mmc_blk_issue_secdiscard_rq() and use mmc_blk_issue_discard_rq() instead.

You could refer this discussion in XDA developers.
    http://forum.xda-developers.com/showthread.php?t=1644364
    https://plus.google.com/111398485184813224730/posts/21pTYfTsCkB#111398485184813224730/posts/21pTYfTsCkB

Regards,
Ian

-----Original Message-----
From: Namjae Jeon [mailto:linkinjeon@gmail.com] 
Sent: Monday, August 13, 2012 10:03 PM
To: IAN CHEN
Cc: cjb@laptop.org; adrian.hunter@intel.com; subhashj@codeaurora.org; linus.walleij@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org; d.j.shin@samsung.com; jongtae22.kim@samsung.com; kyungmin.park@samsung.com; jh80.chung@samsung.com
Subject: Re: [PATCH] mmc: card: Skip secure option for MoviNAND.

Hi. Ian.

known issue ? Would you explain more ?

Thanks.

2012/8/13 IAN CHEN <ian.cy.chen@samsung.com>:
> From 5c60eb8be04c7440d6e33b8f72ea2046a3657ac4 Mon Sep 17 00:00:00 2001
> From: ian.cy.chen <ian.cy.chen@samsung.com>
> Date: Mon, 13 Aug 2012 10:53:55 +0900
> Subject: [PATCH] mmc: card: Skip secure option for MoviNAND.
>
> For several MoviNAND, there are some known issue with secure option.
> For these specific MoviNAND device, we skip secure option.
>
> Signed-off-by: Ian Chen <ian.cy.chen@samsung.com>
> ---
>  drivers/mmc/card/block.c |   24 +++++++++++++++++++++++-
>  include/linux/mmc/card.h |    1 +
>  2 files changed, 24 insertions(+), 1 deletions(-)
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-14  2:12   ` IAN CHEN
@ 2012-08-14  3:51     ` Namjae Jeon
  2012-08-14  8:03       ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Namjae Jeon @ 2012-08-14  3:51 UTC (permalink / raw)
  To: IAN CHEN
  Cc: cjb, adrian.hunter, subhashj, linus.walleij, linux-mmc,
	linux-kernel, d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

Hi. Ian.

Okay, I see. plz add this address in changelog.

I also agree about Linus's suggestion.
So Would you change flag name to be neutral ?
We can distinguish samsung movinand by CID_MANFID_SAMSUNG.
And will reuse quirk flag when same issue occurred from other vendor's
mmc deivce.

Thanks.

2012/8/14, IAN CHEN <ian.cy.chen@samsung.com>:
> Dear Mr. Jeon,
>
> This is workaround for some Samsung eMMC, MoviNAND.
> There are known issue about secure erase & secure trim with these eMMC
> device which I listed by product_name.
> Therefore, for these eMMC devices, we just skip
> mmc_blk_issue_secdiscard_rq() and use mmc_blk_issue_discard_rq() instead.
>
> You could refer this discussion in XDA developers.
>     http://forum.xda-developers.com/showthread.php?t=1644364
>
> https://plus.google.com/111398485184813224730/posts/21pTYfTsCkB#111398485184813224730/posts/21pTYfTsCkB
>
> Regards,
> Ian
>
> -----Original Message-----
> From: Namjae Jeon [mailto:linkinjeon@gmail.com]
> Sent: Monday, August 13, 2012 10:03 PM
> To: IAN CHEN
> Cc: cjb@laptop.org; adrian.hunter@intel.com; subhashj@codeaurora.org;
> linus.walleij@linaro.org; linux-mmc@vger.kernel.org;
> linux-kernel@vger.kernel.org; d.j.shin@samsung.com;
> jongtae22.kim@samsung.com; kyungmin.park@samsung.com;
> jh80.chung@samsung.com
> Subject: Re: [PATCH] mmc: card: Skip secure option for MoviNAND.
>
> Hi. Ian.
>
> known issue ? Would you explain more ?
>
> Thanks.
>
> 2012/8/13 IAN CHEN <ian.cy.chen@samsung.com>:
>> From 5c60eb8be04c7440d6e33b8f72ea2046a3657ac4 Mon Sep 17 00:00:00 2001
>> From: ian.cy.chen <ian.cy.chen@samsung.com>
>> Date: Mon, 13 Aug 2012 10:53:55 +0900
>> Subject: [PATCH] mmc: card: Skip secure option for MoviNAND.
>>
>> For several MoviNAND, there are some known issue with secure option.
>> For these specific MoviNAND device, we skip secure option.
>>
>> Signed-off-by: Ian Chen <ian.cy.chen@samsung.com>
>> ---
>>  drivers/mmc/card/block.c |   24 +++++++++++++++++++++++-
>>  include/linux/mmc/card.h |    1 +
>>  2 files changed, 24 insertions(+), 1 deletions(-)
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: card: Skip secure option for MoviNAND.
  2012-08-14  3:51     ` Namjae Jeon
@ 2012-08-14  8:03       ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-08-14  8:03 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: IAN CHEN, cjb, adrian.hunter, subhashj, linux-mmc, linux-kernel,
	d.j.shin, jongtae22.kim, kyungmin.park, jh80.chung

On Tue, Aug 14, 2012 at 5:51 AM, Namjae Jeon <linkinjeon@gmail.com> wrote:

> So Would you change flag name to be neutral ?

MMC_QUIRK_SEC_ERASE_TRIM_BROKEN

It appears that mmc_blk_issue_secdiscard_rq() always use both
erase and trim (given helpers like mmc_can_secure_erase_trim())
so if either is broken we set this flag.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-14  8:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-13  9:50 [PATCH] mmc: card: Skip secure option for MoviNAND IAN CHEN
2012-08-13 13:02 ` Namjae Jeon
2012-08-14  2:10   ` IAN CHEN
2012-08-14  2:12   ` IAN CHEN
2012-08-14  3:51     ` Namjae Jeon
2012-08-14  8:03       ` Linus Walleij
2012-08-13 13:39 ` Linus Walleij

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).