All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grégory Soutadé" <gsoutade@neotion.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <chris@printf.net>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v6 0000/0003] mmc: EXT_CSD_PARTITION_SETTING_COMPLETED bit not checked
Date: Mon, 15 Sep 2014 17:47:03 +0200	[thread overview]
Message-ID: <541709F7.1040502@neotion.com> (raw)
In-Reply-To: <541303B2.7050802@neotion.com>

JEDEC standard requires that EXT_CSD_PARTITION_SETTING_COMPLETED bit
must be set in order to take in account enhanced area and general purpose
partitions (gp) values.

Current code doesn't checks this bit and blindly trust enhanced area and
gp values. Moreover, "enhanced_area_en" attribute was set according to gp values
but not necessary enhanced area one. It's then used to switch
EXT_CSD_ERASE_GROUP_DEF bit which requires EXT_CSD_PARTITION_SETTING_COMPLETED.
This attribute has been replaced by "partition_setting_completed" that
match the expected behavior.

User is now warned in case of misconfiguration.

Plus, some code has been moved into functions for two reasons :
* Functional reason (one behavior per function)
* Deep indentation result

Grégory Soutadé (3):
  mmc: Move code that manages user area and gp partitions into functions
  mmc: Replace "enhanced_area_en" attribute by "partition_setting_completed"
  mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED before partitions computation

 drivers/mmc/core/mmc.c   |  172 ++++++++++++++++++++++++++--------------------
 include/linux/mmc/card.h |    2 +-
 include/linux/mmc/mmc.h  |    2 +
 3 files changed, 102 insertions(+), 74 deletions(-)

>From commit 7ec62d421bdf29cb31101ae2689f7f3a9906289a in master linux tree.

Changelog v5:
	Remove some useless braces
Changelog v4:
	Second patch in v3 doesn't compile
Changelog v3:
	Move code BEFORE fixing bugs.
Changelog v2:
	Move code for user area and general purpose partitions
	into functions.
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: "Grégory Soutadé" <gsoutade@neotion.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <chris@printf.net>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v6 0000/0003] mmc: EXT_CSD_PARTITION_SETTING_COMPLETED bit not checked
Date: Mon, 15 Sep 2014 17:47:03 +0200	[thread overview]
Message-ID: <541709F7.1040502@neotion.com> (raw)
In-Reply-To: <541303B2.7050802@neotion.com>

JEDEC standard requires that EXT_CSD_PARTITION_SETTING_COMPLETED bit
must be set in order to take in account enhanced area and general purpose
partitions (gp) values.

Current code doesn't checks this bit and blindly trust enhanced area and
gp values. Moreover, "enhanced_area_en" attribute was set according to gp values
but not necessary enhanced area one. It's then used to switch
EXT_CSD_ERASE_GROUP_DEF bit which requires EXT_CSD_PARTITION_SETTING_COMPLETED.
This attribute has been replaced by "partition_setting_completed" that
match the expected behavior.

User is now warned in case of misconfiguration.

Plus, some code has been moved into functions for two reasons :
* Functional reason (one behavior per function)
* Deep indentation result

Grégory Soutadé (3):
  mmc: Move code that manages user area and gp partitions into functions
  mmc: Replace "enhanced_area_en" attribute by "partition_setting_completed"
  mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED before partitions computation

 drivers/mmc/core/mmc.c   |  172 ++++++++++++++++++++++++++--------------------
 include/linux/mmc/card.h |    2 +-
 include/linux/mmc/mmc.h  |    2 +
 3 files changed, 102 insertions(+), 74 deletions(-)

From commit 7ec62d421bdf29cb31101ae2689f7f3a9906289a in master linux tree.

Changelog v5:
	Remove some useless braces
Changelog v4:
	Second patch in v3 doesn't compile
Changelog v3:
	Move code BEFORE fixing bugs.
Changelog v2:
	Move code for user area and general purpose partitions
	into functions.
-- 
1.7.9.5

  reply	other threads:[~2014-09-15 15:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 14:57 [PATCH] mmc: check EXT_CSD_PARTITION_SETTING_COMPLETED before creating partitions Grégory Soutadé
2014-07-17 14:57 ` Grégory Soutadé
2014-08-13  8:36 ` Ulf Hansson
2014-08-13  9:20   ` Grégory Soutadé
2014-08-14 11:46     ` Ulf Hansson
2014-08-14 13:27       ` Grégory Soutadé
2014-08-15  8:17         ` Ulf Hansson
2014-08-18 13:12           ` [PATCH v3 0001/0002] mmc: Replace ext_csd "enhanced_area_en" attribute by "partition_setting_completed" Grégory Soutadé
2014-09-11  6:38             ` [PATCH v4 0001/0003] mmc: Move code that manages user area and gp partitions into functions Grégory Soutadé
2014-09-12 14:31               ` [PATCH v5 0000/0003] mmc: EXT_CSD_PARTITION_SETTING_COMPLETED bit not checked Grégory Soutadé
2014-09-12 14:31                 ` Grégory Soutadé
2014-09-15 15:47                 ` Grégory Soutadé [this message]
2014-09-15 15:47                   ` [PATCH v6 " Grégory Soutadé
2014-09-12 14:31               ` [PATCH v5 0001/0003] mmc: Move code that manages user area and gp partitions into functions Grégory Soutadé
2014-09-15 15:47                 ` [PATCH v6 " Grégory Soutadé
2014-09-17 22:12                   ` Ulf Hansson
2014-09-12 14:31               ` [PATCH v5 0002/0003] mmc: Replace "enhanced_area_en" attribute by "partition_setting_completed" Grégory Soutadé
2014-09-15  4:20                 ` Jaehoon Chung
2014-09-15 15:47                   ` [PATCH v6 " Grégory Soutadé
2014-09-17 22:12                     ` Ulf Hansson
2014-09-12 14:31               ` [PATCH v5 0003/0003] mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED before partitions computation Grégory Soutadé
2014-09-15 15:47                 ` [PATCH v6 " Grégory Soutadé
2014-09-17 22:13                   ` Ulf Hansson
2014-09-11  6:38             ` [PATCH v4 0002/0003] mmc: Replace "enhanced_area_en" attribute by "partition_setting_completed" Grégory Soutadé
2014-09-11  9:46               ` Ulf Hansson
2014-09-11  6:38             ` [PATCH v4 0003/0003] mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED before partitions computation Grégory Soutadé
2014-08-18 13:12           ` [PATCH v3 0002/0002] mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED bit " Grégory Soutadé
2014-09-08 12:15             ` Ulf Hansson
2014-08-18 10:49         ` [PATCH v2 0001/0002] mmc: check EXT_CSD_PARTITION_SETTING_COMPLETED before creating partitions Grégory Soutadé
2014-08-18 10:50 ` [PATCH v2 0002/0002] " Grégory Soutadé
2014-08-18 12:15   ` Ulf Hansson

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=541709F7.1040502@neotion.com \
    --to=gsoutade@neotion.com \
    --cc=chris@printf.net \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.