<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/nvme, branch v2021.07</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/nvme?h=v2021.07</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/nvme?h=v2021.07'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2021-06-23T09:21:14Z</updated>
<entry>
<title>nvme: Don't clear nvme blk device's priv space</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-06-22T13:16:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=78d5f2011e2acf8e2f259d2886f1ceb4d789e0be'/>
<id>urn:sha1:78d5f2011e2acf8e2f259d2886f1ceb4d789e0be</id>
<content type='text'>
A udevice's priv space is cleared in alloc_priv() in the DM core.
Don't do it again in its probe() routine.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Drop useless members of 'struct nvme_ns'</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-06-22T13:16:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=757cc4b1b2725e445a94840aa6076f0f0d4f03b9'/>
<id>urn:sha1:757cc4b1b2725e445a94840aa6076f0f0d4f03b9</id>
<content type='text'>
mode_select_num_blocks and mode_select_block_len in 'struct nvme_ns'
are not useful. Drop them.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Eliminate the offset of one during block dev creation</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-06-22T13:16:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8c60d40d69fd834f67322bbcea06ef0adf9076e1'/>
<id>urn:sha1:8c60d40d69fd834f67322bbcea06ef0adf9076e1</id>
<content type='text'>
At present there is an offset of one added during the creation of
block device. This can be very confusing as we wanted to encode the
namespace id in the block device name but namespae id cannot be zero.

This changes to use the namespace id directly in the block device
name, eliminating the offset of one effectively.

Suggested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Skip block device creation for inactive namespaces</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-06-22T13:16:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=478f7fc6a04ae81af550b56b31f18af24cf3f262'/>
<id>urn:sha1:478f7fc6a04ae81af550b56b31f18af24cf3f262</id>
<content type='text'>
At present for each namespace there is a block device created for it.
There is no issue if the number of supported namespaces reported from
the NVMe device is only 1.

Since QEMU commit 7f0f1acedf15 ("hw/block/nvme: support multiple namespaces"),
the number of supported namespaces reported has been changed from 1
to 256, but not all of them are active namespaces. The actual active
one depends on the QEMU command line parameters. A common case is
that namespace 1 being active and all other 255 being inactive.

If a namespace is inactive, the namespace identify command returns a
zero filled data structure. We can use field NSZE (namespace size) to
decide whether a block device should be created for it.

Reported-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Move block dev creation from uclass post_probe() to driver probe()</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-06-22T13:16:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=84344258f23fb9ac5abe7383c909f8606ac767b6'/>
<id>urn:sha1:84344258f23fb9ac5abe7383c909f8606ac767b6</id>
<content type='text'>
At present the block device creation happens in the NVMe uclass
driver post_probe() phase. In preparation to support multiple
namespaces, we should issue namespace identify before creating
block devices but that touches the underlying hardware hence it
is not appropriate to do such in the uclass driver post_probe().
Let's move it to driver probe() phase instead.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Remove the redundant aqa value setting</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Wesley Sheng</name>
<email>wesleyshenggit@sina.com</email>
</author>
<published>2021-06-22T03:34:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c3e52c71bb0e7e5e34fadafbfcc34bce9899c100'/>
<id>urn:sha1:c3e52c71bb0e7e5e34fadafbfcc34bce9899c100</id>
<content type='text'>
AQA (Admin Queue Attributes) register is a dword size with
lower word of ASQS, and higher word of ACQS.

The code set the variable aqa twice, but it is redundant.

Signed-off-by: Wesley Sheng &lt;wesleyshenggit@sina.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Correct the prps per page calculation method</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>Wesley Sheng</name>
<email>wesleyshenggit@sina.com</email>
</author>
<published>2021-06-22T03:34:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=859b33c948945f7904f60a2c12a3792d356d51ad'/>
<id>urn:sha1:859b33c948945f7904f60a2c12a3792d356d51ad</id>
<content type='text'>
Each prp is 8 bytes, calculate the number of prps
per page should just divide page size by 8
there is no need to minus 1

Signed-off-by: Wesley Sheng &lt;wesleyshenggit@sina.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: fix for big endian systems</title>
<updated>2021-06-23T09:21:14Z</updated>
<author>
<name>David Lamparter</name>
<email>equinox@diac24.net</email>
</author>
<published>2021-05-06T18:24:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b12f62374e83675bc65174c2b4b7e3c6c368aa78'/>
<id>urn:sha1:b12f62374e83675bc65174c2b4b7e3c6c368aa78</id>
<content type='text'>
writel() and co. already include the endian swap;  doing the swap twice
is, er, unhelpful.

Tested on a P4080DS, which boots perfectly fine off NVMe with this.

Signed-off-by: David Lamparter &lt;equinox@diac24.net&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Elaborate on cache maintenance operation in get/set_features</title>
<updated>2021-03-19T14:36:55Z</updated>
<author>
<name>Andre Przywara</name>
<email>andre.przywara@arm.com</email>
</author>
<published>2021-03-02T15:43:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4c498796891a26a7283130f367a346096a6ccce7'/>
<id>urn:sha1:4c498796891a26a7283130f367a346096a6ccce7</id>
<content type='text'>
At the moment the nvme_get_features() and nvme_set_features() functions
carry a (somewhat misleading) comment about missing cache maintenance.

As it turns out, nvme_get_features() has no caller at all in the tree,
and nvme_set_features' only user doesn't use a DMA buffer.

Mention that in the comment, and leave some breadcrumbs for the future,
should those functions attract more users.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Always invalidate whole cqes[] array</title>
<updated>2021-03-19T14:36:53Z</updated>
<author>
<name>Andre Przywara</name>
<email>andre.przywara@arm.com</email>
</author>
<published>2021-02-08T13:31:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d0c04926cd054cf7360ec15913ac17a465f32603'/>
<id>urn:sha1:d0c04926cd054cf7360ec15913ac17a465f32603</id>
<content type='text'>
At the moment nvme_read_completion_status() tries to invalidate a single
member of the cqes[] array, which is shady as just a single entry is
not cache line aligned.
The structure is dictated by hardware, and with 16 bytes is smaller than
any cache line we usually deal with. Also multiple entries need to be
consecutive in memory, so we can't pad them to cover a whole cache line.

As a consequence we can only always invalidate all of them - U-Boot just
uses two of them anyway. This is fine, as they are only ever read by the
CPU (apart from the initial zeroing), so they can't become dirty.

Make this obvious by always invalidating the whole array, regardless of
the entry number we are about to read.
Also blow up the allocation size to cover whole cache lines, to avoid
other heap allocations to sneak in.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Tested-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
</content>
</entry>
</feed>
