public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] DOS_PBR block type is also valid dos block type.
Date: Wed, 13 Mar 2013 10:51:43 -0600	[thread overview]
Message-ID: <5140AE9F.9020204@wwwdotorg.org> (raw)
In-Reply-To: <CAJxxZ0OGqM2QHZg5RwbBaWv6X--hd8=dB--Dx33YGW5ve+Q=hg@mail.gmail.com>

On 03/12/2013 08:58 PM, Sonic Zhang wrote:
> Hi Stephen,
> 
> On Tue, Mar 12, 2013 at 11:09 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 03/11/2013 08:57 PM, Sonic Zhang wrote:
>>> Hi Stephen,
>>>
>>>
>>> On Tue, Mar 12, 2013 at 1:28 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>> On 03/11/2013 03:56 AM, sonic.adi at gmail.com wrote:
>>>>> From: Sonic Zhang <sonic.zhang@analog.com>
>>>>>
>>>>> - Should return 0 for both DOS_MBR and DOS_PBR block types in test_part_dos().
>>>>
>>>> What problem does this solve?
>>>>
>>>> I don't believe this change is correct. The purpose of test_part_dos()
>>>> is to determine whether a block device contains an MS-DOS partition table.
>>>>
>>>> Such a partition table is present in an MBR, but not a PBR. A PBR
>>>> contains a *FAT file-system, and does not include a partition table.
>>>
>>> The SD card formated by windows 7 into one FAT partition can't be
>>> initialized correct in u-boot function init_part() after you reuses
>>> function test_block_type() in function test_part_dos(). So, files on
>>> that partition can't be displayed when run command "fatls mmc 0".
>>>
>>> The only difference in your change is to mark dos partition with flag
>>> DOS_PBR invalid.
>>
>> I did test a raw FAT filesystem on an SD card without any partition
>> table, and it worked fine. Admittedly I created the layout/filesystem
>> with Linux rather than Windows, but I don't think the layout would be
>> any difference. What if you "fatls mmc 0:0" rather than "fatls mmc 0";
>> does that make any difference?
> 
> "fatls mmc 0:0" makes no difference.

I have reproduced this. However, I believe it's not a simple "the code
is wrong" issue, but rather some kind of issue with stale state sticking
around.

In other words, the following works just fine:

========
Reset the board

Insert an SD card with a raw FAT filesystem; no partitions

Tegra20 (SeaBoard) # ls mmc 1
  3637576   zimage
        0   raw-fat-no-partititions

2 file(s), 0 dir(s)
========

(I have a file named raw-fat-no-partitions on the card so I can easily
identify it)

However, the following fails:

========
Reset the board

Insert an SD card with DOS partition table, two partitions, each
containing a FAT filesystem

Tegra20 (SeaBoard) # ls mmc 1
  3637576   zimage
        0   part-id-1

2 file(s), 0 dir(s)

Insert an SD card with a raw FAT filesystem; no partitions

Tegra20 (SeaBoard) # mmc rescan 1
Tegra20 (SeaBoard) # ls mmc 1
** Can't read partition table on 1:0 **
** Invalid partition 1 **
========

(Again, I have a file named part-id-1 on the other card so I can easily
identify it)

This reproduces all the way back to at least commit d1efb64 "disk:
part_dos: don't claim whole-disk FAT filesystems", which is where I
fixed raw-FAT-filesystem-without-partition-tables, and is the change you
wanted to revert.

I'll see if I can track down what's going on.

  reply	other threads:[~2013-03-13 16:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11  9:56 [U-Boot] [PATCH v1] DOS_PBR block type is also valid dos block type sonic.adi at gmail.com
2013-03-11 17:28 ` Stephen Warren
2013-03-12  2:59   ` Sonic Zhang
2013-03-13 17:11     ` Stephen Warren
2013-03-14  2:51       ` Sonic Zhang
2013-03-14  4:36         ` Stephen Warren
2013-03-14  7:31           ` Sonic Zhang
2013-03-14 17:53             ` Stephen Warren
2013-03-15  5:10     ` Stephen Warren
2013-03-15  6:36       ` Sonic Zhang
2013-03-15 13:14         ` Tom Rini
2013-03-15 17:09         ` Stephen Warren
2013-03-15 17:29           ` Tom Rini
2013-03-15 12:46       ` Tom Rini
2013-03-15 17:07         ` Stephen Warren
     [not found]   ` <CAJxxZ0Pk2CtS0FuYJyZDqq3NyUZEnCjnjsksx7buv8RiLf+3vQ@mail.gmail.com>
     [not found]     ` <513E9C79.2000708@wwwdotorg.org>
2013-03-13  2:58       ` Sonic Zhang
2013-03-13 16:51         ` Stephen Warren [this message]
2013-03-13 17:01           ` Stephen Warren

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=5140AE9F.9020204@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /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