* Question reg. parsing of mtd partitions
@ 2011-06-09  8:34 Dmitry Eremin-Solenikov
  2011-06-09  9:08 ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-09  8:34 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1
Hello, colleagues,
While doing MTD partitions cleanup I noticed one strange thing.
parse_mtd_partitions function bears one extra argument (origin)
which isn't clearly described, set to non-zero only by ixp4xx.c
driver and then read by redboot partition table handling. I wander if we
can add some other way to handle this situation and drop this extra 0
argument from lots of drivers/handlers/etc.
Could you please check it?
-- 
With best wishes
Dmitry
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Question reg. parsing of mtd partitions
  2011-06-09  8:34 Question reg. parsing of mtd partitions Dmitry Eremin-Solenikov
@ 2011-06-09  9:08 ` Dmitry Eremin-Solenikov
  2011-06-09  9:23   ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-09  9:08 UTC (permalink / raw)
  To: linux-mtd
  Cc: Brian Walsh, Thomas Gleixner, David Woodhouse, Deepak Sanexa,
	dedekind1
On 09.06.2011 12:34, Dmitry Eremin-Solenikov wrote:
> Hello, colleagues,
>
> While doing MTD partitions cleanup I noticed one strange thing.
> parse_mtd_partitions function bears one extra argument (origin)
> which isn't clearly described, set to non-zero only by ixp4xx.c
> driver and then read by redboot partition table handling. I wander if we
> can add some other way to handle this situation and drop this extra 0
> argument from lots of drivers/handlers/etc.
>
> Could you please check it?
At least the ixp4xx part was added by commit f40a6f1cc7fe522,
back in 2006:
If the amount of flash is not divisible by 2 then the mask in
parse_mtd_partitions would fail to work as designed.  Passing in the 
base address corrects this problem.
-- 
With best wishes
Dmitry
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Question reg. parsing of mtd partitions
  2011-06-09  9:08 ` Dmitry Eremin-Solenikov
@ 2011-06-09  9:23   ` Dmitry Eremin-Solenikov
  2011-06-10 12:49     ` Brian Walsh
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-09  9:23 UTC (permalink / raw)
  To: linux-mtd
  Cc: Brian Walsh, Thomas Gleixner, David Woodhouse, Deepak Sanexa,
	dedekind1
On 6/9/11, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> On 09.06.2011 12:34, Dmitry Eremin-Solenikov wrote:
>> Hello, colleagues,
>>
>> While doing MTD partitions cleanup I noticed one strange thing.
>> parse_mtd_partitions function bears one extra argument (origin)
>> which isn't clearly described, set to non-zero only by ixp4xx.c
>> driver and then read by redboot partition table handling. I wander if we
>> can add some other way to handle this situation and drop this extra 0
>> argument from lots of drivers/handlers/etc.
>>
>> Could you please check it?
>
> At least the ixp4xx part was added by commit f40a6f1cc7fe522,
> back in 2006:
>
> If the amount of flash is not divisible by 2 then the mask in
> parse_mtd_partitions would fail to work as designed.  Passing in the
> base address corrects this problem.
Found the original patch/report at
http://thread.gmane.org/gmane.linux.ports.arm.kernel/24662
Awaiting for comments on this.
-- 
With best wishes
Dmitry
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Question reg. parsing of mtd partitions
  2011-06-09  9:23   ` Dmitry Eremin-Solenikov
@ 2011-06-10 12:49     ` Brian Walsh
  2011-06-10 13:09       ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Walsh @ 2011-06-10 12:49 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: David Woodhouse, Thomas Gleixner, linux-mtd, Deepak Sanexa,
	dedekind1
On Thursday, June 09, 2011 05:23:31 am Dmitry Eremin-Solenikov wrote:
> On 6/9/11, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> > On 09.06.2011 12:34, Dmitry Eremin-Solenikov wrote:
> >> Hello, colleagues,
> >>
> >> While doing MTD partitions cleanup I noticed one strange thing.
> >> parse_mtd_partitions function bears one extra argument (origin)
> >> which isn't clearly described, set to non-zero only by ixp4xx.c
> >> driver and then read by redboot partition table handling. I wander if we
> >> can add some other way to handle this situation and drop this extra 0
> >> argument from lots of drivers/handlers/etc.
> >>
> >> Could you please check it?
> >
> > At least the ixp4xx part was added by commit f40a6f1cc7fe522,
> > back in 2006:
> >
> > If the amount of flash is not divisible by 2 then the mask in
> > parse_mtd_partitions would fail to work as designed.  Passing in the
> > base address corrects this problem.
> 
> Found the original patch/report at
> http://thread.gmane.org/gmane.linux.ports.arm.kernel/24662
> 
> Awaiting for comments on this.
> 
The problem apparently only affects ixp4xx based boards running RedBoot as a 
boot loader. I thought that it should possibly go as a fix in 
drivers/mtd/redboot.c but I found the dev->resource->start parameter to 
parse_mtd_partitions to be the most graceful at the time.
RedBoot on ixp4xx based boards starts flash addresses at 0x50000000 which Linux
then starts at 0. So the partition table address entries are all offset by the 
RedBoot start point.
I may be the only one who actually ran into the problem. I was working with a 
modified design that only had 48MB of flash. So as far as I am concerned it can
be dropped. If every other board is using zero for that parameter it seems like
it would make more sense to handle this condition in drivers/mtd/redboot.c?
Brian
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Question reg. parsing of mtd partitions
  2011-06-10 12:49     ` Brian Walsh
@ 2011-06-10 13:09       ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-10 13:09 UTC (permalink / raw)
  To: Brian Walsh
  Cc: David Woodhouse, Thomas Gleixner, linux-mtd, Deepak Sanexa,
	dedekind1
On 6/10/11, Brian Walsh <brian@walsh.ws> wrote:
> On Thursday, June 09, 2011 05:23:31 am Dmitry Eremin-Solenikov wrote:
>> On 6/9/11, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>> > On 09.06.2011 12:34, Dmitry Eremin-Solenikov wrote:
>> >> Hello, colleagues,
>> >>
>> >> While doing MTD partitions cleanup I noticed one strange thing.
>> >> parse_mtd_partitions function bears one extra argument (origin)
>> >> which isn't clearly described, set to non-zero only by ixp4xx.c
>> >> driver and then read by redboot partition table handling. I wander if
>> >> we
>> >> can add some other way to handle this situation and drop this extra 0
>> >> argument from lots of drivers/handlers/etc.
>> >>
>> >> Could you please check it?
>> >
>> > At least the ixp4xx part was added by commit f40a6f1cc7fe522,
>> > back in 2006:
>> >
>> > If the amount of flash is not divisible by 2 then the mask in
>> > parse_mtd_partitions would fail to work as designed.  Passing in the
>> > base address corrects this problem.
>>
>> Found the original patch/report at
>> http://thread.gmane.org/gmane.linux.ports.arm.kernel/24662
>>
>> Awaiting for comments on this.
>>
>
> The problem apparently only affects ixp4xx based boards running RedBoot as a
> boot loader. I thought that it should possibly go as a fix in
> drivers/mtd/redboot.c but I found the dev->resource->start parameter to
> parse_mtd_partitions to be the most graceful at the time.
>
> RedBoot on ixp4xx based boards starts flash addresses at 0x50000000 which
> Linux
> then starts at 0. So the partition table address entries are all offset by
> the
> RedBoot start point.
>
> I may be the only one who actually ran into the problem. I was working with
> a
> modified design that only had 48MB of flash. So as far as I am concerned it
> can
> be dropped. If every other board is using zero for that parameter it seems
> like
> it would make more sense to handle this condition in drivers/mtd/redboot.c?
I see your problem. It seems default code depends on size being a power of 2
_and_ start addr being aligned to the flash size. I think that usually that is
correct assumption, but we will need some override for the cases like yours.
Anyway I'm going to agree on the Artem's way to handle such cases.
-- 
With best wishes
Dmitry
^ permalink raw reply	[flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-11 11:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09  8:34 Question reg. parsing of mtd partitions Dmitry Eremin-Solenikov
2011-06-09  9:08 ` Dmitry Eremin-Solenikov
2011-06-09  9:23   ` Dmitry Eremin-Solenikov
2011-06-10 12:49     ` Brian Walsh
2011-06-10 13:09       ` Dmitry Eremin-Solenikov
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).