<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/mtd/maps/physmap.c, branch v2.6.38.6</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-physmap: add support users can assign the probe type in board files</title>
<updated>2010-08-08T11:28:15+00:00</updated>
<author>
<name>Barry Song</name>
<email>21cnbao@gmail.com</email>
</author>
<published>2010-01-15T07:50:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=78ef7fab0eb0a5b159842bac89aed74bb0aa7bfe'/>
<id>78ef7fab0eb0a5b159842bac89aed74bb0aa7bfe</id>
<content type='text'>
There are three reasons to add this support:
1. users probably know the interface type of their flashs, then probe
can be faster if they give the right type in platform data since wrong
types will not be detected.
2. sometimes, detecting can cause destory to system. For example, for
kernel XIP, detecting can cause NOR enter a mode instructions can not
be fetched right, which will make kernel crash.
3. For a new probe which is not listed in the rom_probe_types, if users
assign it in board files, physmap can still probe it.

Signed-off-by: Barry Song &lt;21cnbao@gmail.com&gt;
Signed-off-by: Mike Frysinger &lt;vapier.adi@gmail.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>
There are three reasons to add this support:
1. users probably know the interface type of their flashs, then probe
can be faster if they give the right type in platform data since wrong
types will not be detected.
2. sometimes, detecting can cause destory to system. For example, for
kernel XIP, detecting can cause NOR enter a mode instructions can not
be fetched right, which will make kernel crash.
3. For a new probe which is not listed in the rom_probe_types, if users
assign it in board files, physmap can still probe it.

Signed-off-by: Barry Song &lt;21cnbao@gmail.com&gt;
Signed-off-by: Mike Frysinger &lt;vapier.adi@gmail.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: physmap: use resource_size()</title>
<updated>2010-08-02T08:03:55+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2010-06-14T16:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1d90d2c3d4ef8ba4f8e05b3578900397333b1bd1'/>
<id>1d90d2c3d4ef8ba4f8e05b3578900397333b1bd1</id>
<content type='text'>
Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.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>
Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd/maps/physmap: catch failure to register MTD_PHYSMAP_COMPAT device</title>
<updated>2010-04-20T07:53:52+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2010-04-02T22:46:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1ca5d2f0196cfca678086fa6f88eec4f9d0307ee'/>
<id>1ca5d2f0196cfca678086fa6f88eec4f9d0307ee</id>
<content type='text'>
If the default Kconfig values are used with MTD_PHYSMAP_COMPAT you end
up with a resource where end &lt; start.  This causes __request_resource to
return a conflict which then returns an -EBUSY error code.  The current
physmap.c code just assumes that the platfom_device_register will always
succeed.

Catch this failure during the physmap_init and propogate the error.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.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>
If the default Kconfig values are used with MTD_PHYSMAP_COMPAT you end
up with a resource where end &lt; start.  This causes __request_resource to
return a conflict which then returns an -EBUSY error code.  The current
physmap.c code just assumes that the platfom_device_register will always
succeed.

Catch this failure during the physmap_init and propogate the error.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: error return -EIO instead of EIO</title>
<updated>2009-11-30T09:51:44+00:00</updated>
<author>
<name>Roel Kluin</name>
<email>roel.kluin@gmail.com</email>
</author>
<published>2009-11-11T20:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=895fb49459227edbb4a4e5a2b5e9d12c34640f84'/>
<id>895fb49459227edbb4a4e5a2b5e9d12c34640f84</id>
<content type='text'>
Return a negative error value instead of a positive

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.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>
Return a negative error value instead of a positive

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Fix compile failure and error path in physmap.c</title>
<updated>2009-10-20T21:29:27+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2009-10-20T16:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8ce110ac19bc88b82e3feacfbb3a2ee08a07fe22'/>
<id>8ce110ac19bc88b82e3feacfbb3a2ee08a07fe22</id>
<content type='text'>
Commit 4b56ffcacee937a85bf39e14872dd141e23ee85f ("mtd: Fix kernel NULL
pointer dereference in physmap.c") introduced a couple of bugs.

It neglected to run the loop of map_destroy() calls in
physmap_flash_remove(), if !info-&gt;cmtd, which would happen if that
function was called to clean up errors during probe.

It also failed to compile if CONFIG_MTD_PARTITIONS was not defined.

Reported-By: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.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>
Commit 4b56ffcacee937a85bf39e14872dd141e23ee85f ("mtd: Fix kernel NULL
pointer dereference in physmap.c") introduced a couple of bugs.

It neglected to run the loop of map_destroy() calls in
physmap_flash_remove(), if !info-&gt;cmtd, which would happen if that
function was called to clean up errors during probe.

It also failed to compile if CONFIG_MTD_PARTITIONS was not defined.

Reported-By: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Fix kernel NULL pointer dereference in physmap.c</title>
<updated>2009-10-20T00:36:04+00:00</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2009-10-19T17:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4b56ffcacee937a85bf39e14872dd141e23ee85f'/>
<id>4b56ffcacee937a85bf39e14872dd141e23ee85f</id>
<content type='text'>
During the probe for physmap platform flash devices there are a
number error exit conditions that all do a goto err_out which
then calls physmap_flash_remove().  In that function one of the
cleanup steps is:

#ifdef CONFIG_MTD_CONCAT
	if (info-&gt;cmtd != info-&gt;mtd[0])
		mtd_concat_destroy(info-&gt;cmtd);
#endif

This test will succeed since info-&gt;cmtd == NULL and info-&gt;mtd[0] is
valid.

Fix this by exiting the remove function when info-&gt;cmtd == NULL.

Also, cleanup the #ifdef CONFIG_MTD_PARTITIONS stuff by using
mtd_has_partitions().

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.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>
During the probe for physmap platform flash devices there are a
number error exit conditions that all do a goto err_out which
then calls physmap_flash_remove().  In that function one of the
cleanup steps is:

#ifdef CONFIG_MTD_CONCAT
	if (info-&gt;cmtd != info-&gt;mtd[0])
		mtd_concat_destroy(info-&gt;cmtd);
#endif

This test will succeed since info-&gt;cmtd == NULL and info-&gt;mtd[0] is
valid.

Fix this by exiting the remove function when info-&gt;cmtd == NULL.

Also, cleanup the #ifdef CONFIG_MTD_PARTITIONS stuff by using
mtd_has_partitions().

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[MTD] Remove mtd-&gt;{suspend,resume} calls from board drivers</title>
<updated>2009-05-26T15:45:44+00:00</updated>
<author>
<name>David Woodhouse</name>
<email>David.Woodhouse@intel.com</email>
</author>
<published>2009-04-05T14:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ccd93854d44710adaa02cecf0ef5f24ab383dd20'/>
<id>ccd93854d44710adaa02cecf0ef5f24ab383dd20</id>
<content type='text'>
Now the MTD core will do this for us, we don't need to hook it up from
the board drivers.

Shame we can't do shutdown from the class too...

Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now the MTD core will do this for us, we don't need to hook it up from
the board drivers.

Shame we can't do shutdown from the class too...

Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[MTD] support driver model updates</title>
<updated>2009-04-04T13:32:59+00:00</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2009-03-26T07:42:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87f39f0493edf7051b1b87c6e9eb7f9a74be8e85'/>
<id>87f39f0493edf7051b1b87c6e9eb7f9a74be8e85</id>
<content type='text'>
Follow-on patch to the previous driver model patch for the MTD
framework.  This one makes various MTD drivers connect to the
driver model tree, so /sys/devices/virtual/mtd/* nodes are no
longer present ... mostly drivers used on boards I have handy.

Based on a patch from Kay Sievers.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&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>
Follow-on patch to the previous driver model patch for the MTD
framework.  This one makes various MTD drivers connect to the
driver model tree, so /sys/devices/virtual/mtd/* nodes are no
longer present ... mostly drivers used on boards I have handy.

Based on a patch from Kay Sievers.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: physmap: fix NULL pointer dereference in error path</title>
<updated>2009-03-10T22:55:11+00:00</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2009-03-10T19:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d58ab5cf09679d8cb4824e22cae900c0eab5ab31'/>
<id>d58ab5cf09679d8cb4824e22cae900c0eab5ab31</id>
<content type='text'>
commit e480814f138cd5d78a8efe397756ba6b6518fdb6 ("[MTD] [MAPS] physmap:
fix wrong free and del_mtd_{partition,device}") introduces a NULL pointer
dereference in physmap_flash_remove when called from the error path in
physmap_flash_probe (if map_probe failed).

Call del_mtd_{partition,device} only if info-&gt;cmtd was not NULL.

Reported-by: pHilipp Zabel &lt;philipp.zabel@gmail.com&gt;
Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e480814f138cd5d78a8efe397756ba6b6518fdb6 ("[MTD] [MAPS] physmap:
fix wrong free and del_mtd_{partition,device}") introduces a NULL pointer
dereference in physmap_flash_remove when called from the error path in
physmap_flash_probe (if map_probe failed).

Call del_mtd_{partition,device} only if info-&gt;cmtd was not NULL.

Reported-by: pHilipp Zabel &lt;philipp.zabel@gmail.com&gt;
Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[MTD] [MAPS] physmap: fix wrong free and del_mtd_{partition,device}</title>
<updated>2009-02-14T08:06:20+00:00</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2009-02-11T21:12:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e480814f138cd5d78a8efe397756ba6b6518fdb6'/>
<id>e480814f138cd5d78a8efe397756ba6b6518fdb6</id>
<content type='text'>
commit 176bf2e0f10ecf1d20a97db3bd5bb2e6ba0b5668 ("physmap: fix leak of
memory returned by parse_mtd_partitions") deals with a memory leak and
frees the pointer array of mtd_partition after the call to
add_mtd_partitions().  the problem is that mtd_table[x]-&gt;name still points
to the freed memory.

Aldo physmap_flash_remove() should call del_mtd_partitions() or
del_mtd_device() only once.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Reported-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;
Tested-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&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>
commit 176bf2e0f10ecf1d20a97db3bd5bb2e6ba0b5668 ("physmap: fix leak of
memory returned by parse_mtd_partitions") deals with a memory leak and
frees the pointer array of mtd_partition after the call to
add_mtd_partitions().  the problem is that mtd_table[x]-&gt;name still points
to the freed memory.

Aldo physmap_flash_remove() should call del_mtd_partitions() or
del_mtd_device() only once.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Reported-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;
Tested-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
