* [PATCH] mmc: card: Do not scan boot partitions
@ 2012-06-12 13:04 Johan Rudholm
2012-06-20 6:18 ` Chris Ball
0 siblings, 1 reply; 8+ messages in thread
From: Johan Rudholm @ 2012-06-12 13:04 UTC (permalink / raw)
To: linux-mmc, Chris Ball; +Cc: Per Forlin, Ulf Hansson, Johan Rudholm
Do not scan boot partitions for "soft" partitions, since the boot
partitions are supposed to contain boot code. Silences the following
message during boot:
mmcblkXbootY: unknown partition table
Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
---
drivers/mmc/card/block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 7e3f453..efdea68 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1515,6 +1515,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
md->disk->queue = md->queue.queue;
md->disk->driverfs_dev = parent;
set_disk_ro(md->disk, md->read_only || default_ro);
+ if (area_type & MMC_BLK_DATA_AREA_BOOT)
+ md->disk->flags = GENHD_FL_NO_PART_SCAN;
/*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
--
1.7.10
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-12 13:04 [PATCH] mmc: card: Do not scan boot partitions Johan Rudholm
@ 2012-06-20 6:18 ` Chris Ball
2012-06-20 7:27 ` Johan Rudholm
0 siblings, 1 reply; 8+ messages in thread
From: Chris Ball @ 2012-06-20 6:18 UTC (permalink / raw)
To: Johan Rudholm; +Cc: linux-mmc, Per Forlin, Ulf Hansson
Hi Johan,
On Tue, Jun 12 2012, Johan Rudholm wrote:
> Do not scan boot partitions for "soft" partitions, since the boot
> partitions are supposed to contain boot code. Silences the following
> message during boot:
>
> mmcblkXbootY: unknown partition table
>
> Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
> ---
> drivers/mmc/card/block.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 7e3f453..efdea68 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1515,6 +1515,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
> md->disk->queue = md->queue.queue;
> md->disk->driverfs_dev = parent;
> set_disk_ro(md->disk, md->read_only || default_ro);
> + if (area_type & MMC_BLK_DATA_AREA_BOOT)
> + md->disk->flags = GENHD_FL_NO_PART_SCAN;
>
> /*
> * As discussed on lkml, GENHD_FL_REMOVABLE should:
Would it be impossible to add a partition table to mmcblkXbootY,
or just unlikely?
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 6:18 ` Chris Ball
@ 2012-06-20 7:27 ` Johan Rudholm
2012-06-20 7:51 ` Ulf Hansson
2012-06-20 8:55 ` Linus Walleij
0 siblings, 2 replies; 8+ messages in thread
From: Johan Rudholm @ 2012-06-20 7:27 UTC (permalink / raw)
To: Chris Ball; +Cc: Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
Hi Chris,
2012/6/20 Chris Ball <cjb@laptop.org>:
> Hi Johan,
>
> On Tue, Jun 12 2012, Johan Rudholm wrote:
>> Do not scan boot partitions for "soft" partitions, since the boot
>> partitions are supposed to contain boot code. Silences the following
>> message during boot:
>>
>> mmcblkXbootY: unknown partition table
>>
>> Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
>> ---
>> drivers/mmc/card/block.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 7e3f453..efdea68 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -1515,6 +1515,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>> md->disk->queue = md->queue.queue;
>> md->disk->driverfs_dev = parent;
>> set_disk_ro(md->disk, md->read_only || default_ro);
>> + if (area_type & MMC_BLK_DATA_AREA_BOOT)
>> + md->disk->flags = GENHD_FL_NO_PART_SCAN;
>>
>> /*
>> * As discussed on lkml, GENHD_FL_REMOVABLE should:
>
> Would it be impossible to add a partition table to mmcblkXbootY,
> or just unlikely?
I believe this is just an unlikely scenario since the boot partitions
are supposed to contain boot code and also because of their relatively
small size (a few MBs), but there is no technical problem. Perhaps it
should be left up to the user? RPMB partitions are an example of
partitions that would actually generate an error on partition scanning
(because they require authentication), but this is not the case for
boot partitions.
Kind regards, Johan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 7:27 ` Johan Rudholm
@ 2012-06-20 7:51 ` Ulf Hansson
2012-06-20 8:55 ` Linus Walleij
1 sibling, 0 replies; 8+ messages in thread
From: Ulf Hansson @ 2012-06-20 7:51 UTC (permalink / raw)
To: Johan Rudholm
Cc: Chris Ball, Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
Hi Johan and Chris,
On 20 June 2012 09:27, Johan Rudholm <jrudholm@gmail.com> wrote:
> Hi Chris,
>
> 2012/6/20 Chris Ball <cjb@laptop.org>:
>> Hi Johan,
>>
>> On Tue, Jun 12 2012, Johan Rudholm wrote:
>>> Do not scan boot partitions for "soft" partitions, since the boot
>>> partitions are supposed to contain boot code. Silences the following
>>> message during boot:
>>>
>>> mmcblkXbootY: unknown partition table
>>>
>>> Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
>>> ---
>>> drivers/mmc/card/block.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index 7e3f453..efdea68 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -1515,6 +1515,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>>> md->disk->queue = md->queue.queue;
>>> md->disk->driverfs_dev = parent;
>>> set_disk_ro(md->disk, md->read_only || default_ro);
>>> + if (area_type & MMC_BLK_DATA_AREA_BOOT)
>>> + md->disk->flags = GENHD_FL_NO_PART_SCAN;
>>>
>>> /*
>>> * As discussed on lkml, GENHD_FL_REMOVABLE should:
>>
>> Would it be impossible to add a partition table to mmcblkXbootY,
>> or just unlikely?
>
> I believe this is just an unlikely scenario since the boot partitions
> are supposed to contain boot code and also because of their relatively
> small size (a few MBs), but there is no technical problem. Perhaps it
> should be left up to the user? RPMB partitions are an example of
> partitions that would actually generate an error on partition scanning
> (because they require authentication), but this is not the case for
> boot partitions.
>
To me this looks like a fair constraint we can put on the boot
partitions. It does not make sense to have a partition table in there.
So I say go ahead with this patch.
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Ulf Hansson
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 7:27 ` Johan Rudholm
2012-06-20 7:51 ` Ulf Hansson
@ 2012-06-20 8:55 ` Linus Walleij
2012-06-20 14:04 ` Johan Rudholm
2012-06-20 17:38 ` Chris Ball
1 sibling, 2 replies; 8+ messages in thread
From: Linus Walleij @ 2012-06-20 8:55 UTC (permalink / raw)
To: Johan Rudholm
Cc: Chris Ball, Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
On Wed, Jun 20, 2012 at 9:27 AM, Johan Rudholm <jrudholm@gmail.com> wrote:
> 2012/6/20 Chris Ball <cjb@laptop.org>:
>>
>> Would it be impossible to add a partition table to mmcblkXbootY,
>> or just unlikely?
>
> I believe this is just an unlikely scenario since the boot partitions
> are supposed to contain boot code and also because of their relatively
> small size (a few MBs), but there is no technical problem. Perhaps it
> should be left up to the user?
Like we add a Kconfig bool option "support partition scanning on boot
partitions" and then we default that to "n", so systems that really
want to do that can turn it on the day they need it.
Could you augment the patch like that?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 8:55 ` Linus Walleij
@ 2012-06-20 14:04 ` Johan Rudholm
2012-06-20 17:38 ` Chris Ball
1 sibling, 0 replies; 8+ messages in thread
From: Johan Rudholm @ 2012-06-20 14:04 UTC (permalink / raw)
To: Linus Walleij
Cc: Chris Ball, Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
Hi Linus,
2012/6/20 Linus Walleij <linus.walleij@linaro.org>:
> On Wed, Jun 20, 2012 at 9:27 AM, Johan Rudholm <jrudholm@gmail.com> wrote:
>> 2012/6/20 Chris Ball <cjb@laptop.org>:
>>>
>>> Would it be impossible to add a partition table to mmcblkXbootY,
>>> or just unlikely?
>>
>> I believe this is just an unlikely scenario since the boot partitions
>> are supposed to contain boot code and also because of their relatively
>> small size (a few MBs), but there is no technical problem. Perhaps it
>> should be left up to the user?
>
> Like we add a Kconfig bool option "support partition scanning on boot
> partitions" and then we default that to "n", so systems that really
> want to do that can turn it on the day they need it.
>
> Could you augment the patch like that?
Sure, I'll send an updated version with this functionality!
//Johan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 8:55 ` Linus Walleij
2012-06-20 14:04 ` Johan Rudholm
@ 2012-06-20 17:38 ` Chris Ball
2012-06-21 8:05 ` Linus Walleij
1 sibling, 1 reply; 8+ messages in thread
From: Chris Ball @ 2012-06-20 17:38 UTC (permalink / raw)
To: Linus Walleij
Cc: Johan Rudholm, Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
Hi,
On Wed, Jun 20 2012, Linus Walleij wrote:
> On Wed, Jun 20, 2012 at 9:27 AM, Johan Rudholm <jrudholm@gmail.com> wrote:
>> 2012/6/20 Chris Ball <cjb@laptop.org>:
>>>
>>> Would it be impossible to add a partition table to mmcblkXbootY,
>>> or just unlikely?
>>
>> I believe this is just an unlikely scenario since the boot partitions
>> are supposed to contain boot code and also because of their relatively
>> small size (a few MBs), but there is no technical problem. Perhaps it
>> should be left up to the user?
>
> Like we add a Kconfig bool option "support partition scanning on boot
> partitions" and then we default that to "n", so systems that really
> want to do that can turn it on the day they need it.
I'm not so happy with adding Kconfig options for configuring driver
behavior -- it's usually a failure to just do the right thing.
If we think that people might want to use a partition table on their
boot partitions then we should just support doing that, as we do now.
In fact, the original patch submission for supporting boot partitions
used a Kconfig entry for turning on boot partition support, but we
decided to ditch the Kconfig entry and made it just happen by default.
I think we should continue that precedent and avoid a new entry here.
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mmc: card: Do not scan boot partitions
2012-06-20 17:38 ` Chris Ball
@ 2012-06-21 8:05 ` Linus Walleij
0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2012-06-21 8:05 UTC (permalink / raw)
To: Chris Ball
Cc: Johan Rudholm, Johan Rudholm, linux-mmc, Per Forlin, Ulf Hansson
On Wed, Jun 20, 2012 at 7:38 PM, Chris Ball <cjb@laptop.org> wrote:
> On Wed, Jun 20 2012, Linus Walleij wrote:
>>
>> Like we add a Kconfig bool option "support partition scanning on boot
>> partitions" and then we default that to "n", so systems that really
>> want to do that can turn it on the day they need it.
>
> I'm not so happy with adding Kconfig options for configuring driver
> behavior -- it's usually a failure to just do the right thing.
This is not for drivers but for the core. But I get the idea...
> If we think that people might want to use a partition table on their
> boot partitions then we should just support doing that, as we do now.
OK in that case I think it's better to disallow partition tables
on the boot partitions, then the day someone has a valid usecase
we can add it back.
So then the patch is good as it is to me:
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-06-21 8:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 13:04 [PATCH] mmc: card: Do not scan boot partitions Johan Rudholm
2012-06-20 6:18 ` Chris Ball
2012-06-20 7:27 ` Johan Rudholm
2012-06-20 7:51 ` Ulf Hansson
2012-06-20 8:55 ` Linus Walleij
2012-06-20 14:04 ` Johan Rudholm
2012-06-20 17:38 ` Chris Ball
2012-06-21 8:05 ` 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).