<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/mtd/cmdlinepart.c, branch v3.10.78</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>mtd: Allow removal of partitioning modules</title>
<updated>2013-02-04T07:27:33+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2013-01-16T01:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=422f3890a68333cfd39f2133cf7255ed067e92e6'/>
<id>422f3890a68333cfd39f2133cf7255ed067e92e6</id>
<content type='text'>
Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: Make it into a module</title>
<updated>2013-02-04T07:27:33+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2013-01-16T01:12:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f5f172dc031ace288c5bb5d18f0b956db08241c2'/>
<id>f5f172dc031ace288c5bb5d18f0b956db08241c2</id>
<content type='text'>
All other partitioning schemes can be compiled as modules

Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All other partitioning schemes can be compiled as modules

Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: update /proc/mtd comment</title>
<updated>2013-02-04T07:26:28+00:00</updated>
<author>
<name>Christopher Cordahi</name>
<email>christophercordahi@nanometrics.ca</email>
</author>
<published>2012-12-18T21:11:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bd6ce5ef913a7b4dfe5cd5028309346d32a8c404'/>
<id>bd6ce5ef913a7b4dfe5cd5028309346d32a8c404</id>
<content type='text'>
/proc/mtd doesn't contain the mtd-id of the device, but the part name from the
command line.  This corrects what I believe is an obsolete comment from commit
a0ee24a03b1c06813c814b9f70946c8984752f01.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Cc: Philip Rakity &lt;prakity@yahoo.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
/proc/mtd doesn't contain the mtd-id of the device, but the part name from the
command line.  This corrects what I believe is an obsolete comment from commit
a0ee24a03b1c06813c814b9f70946c8984752f01.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Cc: Philip Rakity &lt;prakity@yahoo.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: describe mtd ordering</title>
<updated>2013-02-04T07:26:28+00:00</updated>
<author>
<name>Christopher Cordahi</name>
<email>christophercordahi@nanometrics.ca</email>
</author>
<published>2012-12-18T21:11:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ea8b8e27fecd44c4fb7b3c6f8f72ea7b92f87fe8'/>
<id>ea8b8e27fecd44c4fb7b3c6f8f72ea7b92f87fe8</id>
<content type='text'>
The mtd documentation makes no mention of the useful feature whereby
partitions' logical ordering need not match their physical ordering.
Truncation of parts, skipping of zero sized parts, and handling of
overlapping parts are similarly not mentioned.

This updates the comments at the top of file describing the command
line parsing as currently implemented.   I proposed this in
http://lists.infradead.org/pipermail/linux-mtd/2012-December/045314.html

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mtd documentation makes no mention of the useful feature whereby
partitions' logical ordering need not match their physical ordering.
Truncation of parts, skipping of zero sized parts, and handling of
overlapping parts are similarly not mentioned.

This updates the comments at the top of file describing the command
line parsing as currently implemented.   I proposed this in
http://lists.infradead.org/pipermail/linux-mtd/2012-December/045314.html

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: skip partitions truncated to zero</title>
<updated>2013-02-04T07:26:28+00:00</updated>
<author>
<name>Christopher Cordahi</name>
<email>christophercordahi@nanometrics.ca</email>
</author>
<published>2012-12-17T00:59:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ebf4f0707df410a7666ec409ee68dc068db56e97'/>
<id>ebf4f0707df410a7666ec409ee68dc068db56e97</id>
<content type='text'>
Perform flash size truncation before skipping zero sized partition
so that if the result is a zero sized, it will be skipped like the
others.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Acked-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Perform flash size truncation before skipping zero sized partition
so that if the result is a zero sized, it will be skipped like the
others.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Acked-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: fix skipping zero sized partition</title>
<updated>2013-02-04T07:26:28+00:00</updated>
<author>
<name>Christopher Cordahi</name>
<email>christophercordahi@nanometrics.ca</email>
</author>
<published>2012-12-17T00:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e25e0a4de1237972a86e5831c8659c4068ff23f7'/>
<id>e25e0a4de1237972a86e5831c8659c4068ff23f7</id>
<content type='text'>
Decrement index i after skipping a zero sized partition.  On next loop
iteration, the index will be the same as before, but the data will be
new as it was moved when earlier partition was skipped.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Acked-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Decrement index i after skipping a zero sized partition.  On next loop
iteration, the index will be the same as before, but the data will be
new as it was moved when earlier partition was skipped.

Signed-off-by: Christopher Cordahi &lt;christophercordahi@nanometrics.ca&gt;
Acked-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: fix the overflow of big mtd partitions</title>
<updated>2012-11-15T17:50:30+00:00</updated>
<author>
<name>Huang Shijie</name>
<email>b32955@freescale.com</email>
</author>
<published>2012-11-01T05:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6f9f59ee2e254a7e997985d8eb708930da49245a'/>
<id>6f9f59ee2e254a7e997985d8eb708930da49245a</id>
<content type='text'>
When the kernel parses the following cmdline

	#mtdparts=gpmi-nand:16m(boot),16m(kernel),1g(home),4g(test),-(usr)

for a big nand chip Micron MT29F64G08AFAAAWP(8GB), we got the following wrong
result:

	.............................................
		"mtd: partition size too small (0)"
	.............................................

We can not get any partition.

The "4g(test)" partition triggers a overflow of the "size". The memparse()
returns 4g to the "size", but the size is "unsigned long" type, so a overflow
occurs, the "size" becomes zero in the end.

This patch changes the "size"/"offset" to "unsigned long long" type,
and replaces the UINT_MAX with ULLONG_MAX for macros SIZE_REMAINING and
OFFSET_CONTINUOUS.

Signed-off-by: Huang Shijie &lt;b32955@freescale.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the kernel parses the following cmdline

	#mtdparts=gpmi-nand:16m(boot),16m(kernel),1g(home),4g(test),-(usr)

for a big nand chip Micron MT29F64G08AFAAAWP(8GB), we got the following wrong
result:

	.............................................
		"mtd: partition size too small (0)"
	.............................................

We can not get any partition.

The "4g(test)" partition triggers a overflow of the "size". The memparse()
returns 4g to the "size", but the size is "unsigned long" type, so a overflow
occurs, the "size" becomes zero in the end.

This patch changes the "size"/"offset" to "unsigned long long" type,
and replaces the UINT_MAX with ULLONG_MAX for macros SIZE_REMAINING and
OFFSET_CONTINUOUS.

Signed-off-by: Huang Shijie &lt;b32955@freescale.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: Simplify parse_cmdline_partitions</title>
<updated>2012-11-15T13:37:45+00:00</updated>
<author>
<name>Shmulik Ladkani</name>
<email>shmulik.ladkani@gmail.com</email>
</author>
<published>2012-09-23T07:52:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=438db5a92b7526a12591f764042528a86d2ebb4b'/>
<id>438db5a92b7526a12591f764042528a86d2ebb4b</id>
<content type='text'>
Simply 'parse_cmdline_partitions': the outer loop iterating over
'partitions' is actually a search loop, it does not execute the inner
loop for each partition, only for the matched partition.

Let's break when search is successful, and move all inner code (relevant
only for the matched partition) outside of the outer loop.

Resulting code is much more readable, and makes the indent level sane.

Signed-off-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simply 'parse_cmdline_partitions': the outer loop iterating over
'partitions' is actually a search loop, it does not execute the inner
loop for each partition, only for the matched partition.

Let's break when search is successful, and move all inner code (relevant
only for the matched partition) outside of the outer loop.

Resulting code is much more readable, and makes the indent level sane.

Signed-off-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: make the partitions rule more strict</title>
<updated>2012-09-29T14:44:25+00:00</updated>
<author>
<name>Shmulik Ladkani</name>
<email>shmulik.ladkani@gmail.com</email>
</author>
<published>2012-09-05T05:30:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7baf04261062826ea225ab23e07c541e279143fa'/>
<id>7baf04261062826ea225ab23e07c541e279143fa</id>
<content type='text'>
Huang Shijie &lt;shijie8@gmail.com&gt; explains:

Assume we have a 1GiB(8Gib) NAND chip, and we set the partitions
in the command line like this:
    #gpmi-nand:100m(boot),100m(kernel),1g(rootfs)

In this case, the partition truncating occurs. The current code will
get the following result:

     ----------------------------------
        root@freescale ~$ cat /proc/mtd
        dev:    size   erasesize  name
        mtd0: 06400000 00040000 "boot"
        mtd1: 06400000 00040000 "kernel"
     ----------------------------------

It is obvious that we lost the truncated partition `rootfs` which should
be 824MiB in this case.

Also, forbid 0-sized partitions.

Signed-off-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Huang Shijie &lt;shijie8@gmail.com&gt; explains:

Assume we have a 1GiB(8Gib) NAND chip, and we set the partitions
in the command line like this:
    #gpmi-nand:100m(boot),100m(kernel),1g(rootfs)

In this case, the partition truncating occurs. The current code will
get the following result:

     ----------------------------------
        root@freescale ~$ cat /proc/mtd
        dev:    size   erasesize  name
        mtd0: 06400000 00040000 "boot"
        mtd1: 06400000 00040000 "kernel"
     ----------------------------------

It is obvious that we lost the truncated partition `rootfs` which should
be 824MiB in this case.

Also, forbid 0-sized partitions.

Signed-off-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: cmdlinepart: minor cleanups</title>
<updated>2012-09-29T14:33:17+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-09-03T06:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fac0077cc0a1760f0afbac6526f56656ee025a34'/>
<id>fac0077cc0a1760f0afbac6526f56656ee025a34</id>
<content type='text'>
Clean-up the driver a bit to make it easier to read and amend the coding style.
Mostly these are changes like:

if (a)
{
}

=&gt;

if (a) {
}

Some extra blank lines were added.
Indentation was changed to use tabs instead of spaces.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clean-up the driver a bit to make it easier to read and amend the coding style.
Mostly these are changes like:

if (a)
{
}

=&gt;

if (a) {
}

Some extra blank lines were added.
Indentation was changed to use tabs instead of spaces.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
