<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/mtd/tests, branch v3.4.2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/mtd/tests?h=v3.4.2</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/mtd/tests?h=v3.4.2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-01-09T18:26:24Z</updated>
<entry>
<title>mtd: introduce mtd_can_have_bb helper</title>
<updated>2012-01-09T18:26:24Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-01-02T11:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8f461a730242c528ca221948edceca49266a3ffb'/>
<id>urn:sha1:8f461a730242c528ca221948edceca49266a3ffb</id>
<content type='text'>
This patch introduces new 'mtd_can_have_bb()' helper function which checks
whether the flash can have bad eraseblocks. Then it changes all the
direct 'mtd-&gt;block_isbad' use cases with 'mtd_can_have_bb()'.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: remove extra retlen assignment</title>
<updated>2012-01-09T18:25:56Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-29T13:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=30fa98480b782999248ce8290136aa58f22536cf'/>
<id>urn:sha1:30fa98480b782999248ce8290136aa58f22536cf</id>
<content type='text'>
MTD functions always assign the 'retlen' argument to 0 at the very
beginning - the callers do not have to do this.

I used the following semantic patch to find these places:

@@
identifier retlen;
expression a, b, c, d, e;
constant C;
type T;
@@
(
- retlen = C;
|
T
-retlen = C
+ retlen
;
)

... when != retlen
    when exists

(
mtd_read(a, b, c, &amp;retlen, d)
|
mtd_write(a, b, c, &amp;retlen, d)
|
mtd_panic_write(a, b, c, &amp;retlen, d)
|
mtd_point(a, b, c, &amp;retlen, d, e)
|
mtd_read_fact_prot_reg(a, b, c, &amp;retlen, d)
|
mtd_write_user_prot_reg(a, b, c, &amp;retlen, d)
|
mtd_read_user_prot_reg(a, b, c, &amp;retlen, d)
|
mtd_writev(a, b, c, d, &amp;retlen)
)

I ran it twice, because there were cases of double zero assigments
in mtd tests. Then I went through the patch to verify that spatch
did not find any false positives.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_block_isbad interface</title>
<updated>2012-01-09T18:25:47Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T17:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7086c19d07429d697057587caf1e5e0345442d16'/>
<id>urn:sha1:7086c19d07429d697057587caf1e5e0345442d16</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_write_oob interface</title>
<updated>2012-01-09T18:25:24Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T16:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d'/>
<id>urn:sha1:a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_read_oob interface</title>
<updated>2012-01-09T18:25:23Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T16:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fd2819bbc92fc98bed5d612e4acbe16b6326f6bf'/>
<id>urn:sha1:fd2819bbc92fc98bed5d612e4acbe16b6326f6bf</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_write interface</title>
<updated>2012-01-09T18:25:20Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T15:35:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eda95cbf75193808f62948fb0142ba0901d8bee2'/>
<id>urn:sha1:eda95cbf75193808f62948fb0142ba0901d8bee2</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_read interface</title>
<updated>2012-01-09T18:25:19Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T15:30:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=329ad399a9b3adf52c90637b21ca029fcf7f8795'/>
<id>urn:sha1:329ad399a9b3adf52c90637b21ca029fcf7f8795</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: introduce mtd_erase interface</title>
<updated>2012-01-09T18:25:11Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2011-12-23T13:25:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7e1f0dc0551b99acb5e8fa161a7ac401994d57d8'/>
<id>urn:sha1:7e1f0dc0551b99acb5e8fa161a7ac401994d57d8</id>
<content type='text'>
This patch is part of a patch-set which changes the MTD interface
from 'mtd-&gt;func()' form to 'mtd_func()' form. We need this because
we want to add common code to to all drivers in the mtd core level,
which is impossible with the current interface when MTD clients
call driver functions like 'read()' or 'write()' directly.

At this point we just introduce a new inline wrapper function, but
later some of them are expected to gain more code. E.g., the input
parameters check should be moved to the wrappers rather than be
duplicated at many drivers.

This particular patch introduced the 'mtd_erase()' interface. The
following patches add all the other interfaces one by one.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>mtd: tests: stresstest: bail out if device has not enough eraseblocks</title>
<updated>2012-01-09T18:12:42Z</updated>
<author>
<name>Wolfram Sang</name>
<email>w.sang@pengutronix.de</email>
</author>
<published>2011-11-29T14:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2f4478ccff7df845dc9c0f8996a96373122c4417'/>
<id>urn:sha1:2f4478ccff7df845dc9c0f8996a96373122c4417</id>
<content type='text'>
stresstest needs at least two eraseblocks. Bail out gracefully if that
condition is not met. Fixes the following 'division by zero' OOPS:

[  619.100000] mtd_stresstest: MTD device size 131072, eraseblock size 131072, page size 2048, count of eraseblocks 1, pages per eraseblock 64, OOB size 64
[  619.120000] mtd_stresstest: scanning for bad eraseblocks
[  619.120000] mtd_stresstest: scanned 1 eraseblocks, 0 are bad
[  619.130000] mtd_stresstest: doing operations
[  619.130000] mtd_stresstest: 0 operations done
[  619.140000] Division by zero in kernel.
...

caused by

        /* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */
        eb %= (ebcnt - 1);

Cc: stable@kernel.org
Signed-off-by: Wolfram Sang &lt;w.sang@pengutronix.de&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>
</entry>
<entry>
<title>mtd: tests: don't use mtd0 as a default</title>
<updated>2011-10-30T12:31:04Z</updated>
<author>
<name>Wolfram Sang</name>
<email>w.sang@pengutronix.de</email>
</author>
<published>2011-10-29T22:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7406060e292c389fe6f38bd23493de9b57f2f4fc'/>
<id>urn:sha1:7406060e292c389fe6f38bd23493de9b57f2f4fc</id>
<content type='text'>
mtd tests may erase the mtd device, so force the user to specify which
mtd device to test by using the module parameter. Disable the default
(using mtd0) since this may destroy a vital part of the flash if the
module is inserted accidently or carelessly.

Reported-by: Roland Kletzing &lt;devzero@web.de&gt;
Signed-off-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@intel.com&gt;
</content>
</entry>
</feed>
