<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/mtd/rawnand.h, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-02-05T15:56:11Z</updated>
<entry>
<title>mtd: rawnand: remove -&gt;legacy.erase and single_erase()</title>
<updated>2019-02-05T15:56:11Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2019-01-21T06:32:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2d73f3d66b7052c0175f9f33d271ae50826c222e'/>
<id>urn:sha1:2d73f3d66b7052c0175f9f33d271ae50826c222e</id>
<content type='text'>
Now that the last user of this hook, denali.c, stopped using it,
we can remove the erase hook from nand_legacy.

I squashed single_erase() because only the difference between
single_erase() and nand_erase_op() is the number of bit shifts.

The status/ret conversion in nand_erase_nand() is unneeded since
commit eb94555e9e97 ("mtd: nand: use usual return values for the
-&gt;erase() hook"). Cleaned it up now.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Boris Brezillon &lt;bbrezillon@kernel.org&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Simplify the locking</title>
<updated>2019-02-05T14:39:40Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-20T10:57:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=013e6292aaf5e4b083a50a0f9e17e93628616860'/>
<id>urn:sha1:013e6292aaf5e4b083a50a0f9e17e93628616860</id>
<content type='text'>
nand_get_device() was complex for apparently no good reason. Let's
replace this locking scheme with 2 mutexes: one attached to the
controller and another one attached to the chip.

Every time the core calls nand_get_device(), it will first lock the
chip and if the chip is not suspended, will then lock the controller.
nand_release_device() will release both lock in the reverse order.

nand_get_device() can sleep, just like the previous implementation,
which means you should never call that from an atomic context.

We also get rid of

- the chip-&gt;state field, since all it was used for was flagging the
  chip as suspended. We replace it by a field called chip-&gt;suspended
  and directly set it from nand_suspend/resume()
- the controller-&gt;wq and controller-&gt;active fields which are no longer
  needed since the new controller-&gt;lock (now a mutex) guarantees that
  all operations are serialized at the controller level
- panic_nand_get_device() which would anyway be a no-op. Talking about
  panic write, I keep thinking the rawnand implementation is unsafe
  because there's not negotiation with the controller to know when it's
  actually done with it's previous operation. I don't intend to fix
  that here, but that's probably something we should look at, or maybe
  we should consider dropping the -&gt;_panic_write() implementation

Last important change to mention: we now return -EBUSY when someone
tries to access a device that as been suspended, and propagate this
error to the upper layer.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Deprecate the dummy_controller field</title>
<updated>2018-12-07T09:58:11Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-20T09:02:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7b6a9b28ecf2fd2e2f5dcdb6d4fa8044b48bdb74'/>
<id>urn:sha1:7b6a9b28ecf2fd2e2f5dcdb6d4fa8044b48bdb74</id>
<content type='text'>
We try to force NAND controller drivers to properly separate the NAND
controller object from the NAND chip one, so let's deprecate the dummy
controller object embedded in nand_chip to encourage them to create
their own instance.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Move -&gt;setup_data_interface() to nand_controller_ops</title>
<updated>2018-12-07T09:38:27Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7a08dbaedd365fa4eb7c9cd504c075e3336eb0c6'/>
<id>urn:sha1:7a08dbaedd365fa4eb7c9cd504c075e3336eb0c6</id>
<content type='text'>
-&gt;setup_data_interface() is a controller specific method and should
thus be placed in nand_controller_ops.

In order to make that work with controllers that support keeping
pre-configured timings we need to add a new NAND_KEEP_TIMINGS flag to
inform the core it should skip the timings selection step.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Move the -&gt;exec_op() method to nand_controller_ops</title>
<updated>2018-12-07T09:38:27Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f2abfeb2078b9682bfeb77f91816fcf2177b3051'/>
<id>urn:sha1:f2abfeb2078b9682bfeb77f91816fcf2177b3051</id>
<content type='text'>
-&gt;exec_op() is a controller method and has nothing to do in the
nand_chip struct. Let's move it to the nand_controller_ops struct and
adjust the core and drivers accordingly.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Deprecate the -&gt;select_chip() hook</title>
<updated>2018-12-07T09:38:27Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7d6c37e90cf9013bd18240cd861b9ae7b006f91f'/>
<id>urn:sha1:7d6c37e90cf9013bd18240cd861b9ae7b006f91f</id>
<content type='text'>
Now that the CS line to be selected is passed to -&gt;exec_op() and
stored in chip-&gt;cur_cs and after patching all drivers implementing
-&gt;exec_op() to stop implementing this method, we can deprecate it by
moving it to the nand_legacy structure.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Pass the CS line to be selected in struct nand_operation</title>
<updated>2018-12-07T09:38:25Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ae2294b10b0f066ef500954b36c94ee11c4ef20f'/>
<id>urn:sha1:ae2294b10b0f066ef500954b36c94ee11c4ef20f</id>
<content type='text'>
In order to deprecate the -&gt;select_chip hook we need to pass the CS
line a NAND operations are targeting. This is done through the
addition of a cs field to the nand_operation struct.

We also need to keep track of the currently selected target to
properly initialize op-&gt;cs, hence the -&gt;cur_cs field addition to the
nand_chip struct.

Note that op-&gt;cs is not assigned in nand_exec_op() because we might
rework the way we execute NAND operations in the future (adopt a
queuing mechanism instead of the serialization we have right now).

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Add nand_[de]select_target() helpers</title>
<updated>2018-12-07T09:38:25Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1d0178593d148e88d2ac1e3f09c7f7eb1c20796b'/>
<id>urn:sha1:1d0178593d148e88d2ac1e3f09c7f7eb1c20796b</id>
<content type='text'>
Add a wrapper to prevent drivers and core code from directly calling
the -&gt;select_chip hook which we are about to deprecate.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Remove unused NAND_CONTROLLER_ALLOC flag</title>
<updated>2018-12-07T09:38:24Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=336058c8f4c2c7991427304c8bde05acef156054'/>
<id>urn:sha1:336058c8f4c2c7991427304c8bde05acef156054</id>
<content type='text'>
Looks like NAND_CONTROLLER_ALLOC has been introduced a long time ago
back when the dummy nand_hw_ctrl object was dynamically allocated
instead of being embedded in nand_chip.

We can safely get rid of this unused flag.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: rawnand: Move nand_exec_op() to internal.h</title>
<updated>2018-12-07T09:38:24Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-11-11T07:55:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1f2d29e634b3e7abc7b62adf6bb4a676615c02ef'/>
<id>urn:sha1:1f2d29e634b3e7abc7b62adf6bb4a676615c02ef</id>
<content type='text'>
nand_exec_op() is only used by core code (nand_xxx.c files). Let's
move this inline function in drivers/mtd/nand/raw/internals.h.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Janusz Krzysztofik &lt;jmkrzyszt@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
</feed>
