<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/nvme, branch v2017.09-rc3</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=v2017.09-rc3</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/nvme?h=v2017.09-rc3'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2017-08-28T11:17:14Z</updated>
<entry>
<title>nvme: Get rid of the global variable nvme_info</title>
<updated>2017-08-28T11:17:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=18aa5a4134e8179c7c3e38675822284a2718a3d8'/>
<id>urn:sha1:18aa5a4134e8179c7c3e38675822284a2718a3d8</id>
<content type='text'>
At present the NVMe uclass driver uses a global variable nvme_info
to store global information like namespace id, and NVMe controller
driver's priv struct has a blk_dev_start that is used to calculate
the namespace id based on the global information from nvme_info.

This is not a good design in the DM world and can be replaced with
the following changes:

- Encode the namespace id in the NVMe block device name during
  the NVMe uclass post probe
- Extract the namespace id from the device name during the NVMe
  block device probe
- Let BLK uclass calculate the devnum for us by passing -1 to
  blk_create_devicef() as the devnum

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Use blk_create_devicef() API</title>
<updated>2017-08-28T11:17:14Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d5b7ee9c6e19993b10b549ac763aa7db8dbacee0'/>
<id>urn:sha1:d5b7ee9c6e19993b10b549ac763aa7db8dbacee0</id>
<content type='text'>
The codes in nvme_uclass_post_probe() can be replaced to call the
blk_create_devicef() API directly.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Apply cache operations on the DMA buffers</title>
<updated>2017-08-28T11:17:13Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=704e040a51d2456a6c56e79363279b230d37cef7'/>
<id>urn:sha1:704e040a51d2456a6c56e79363279b230d37cef7</id>
<content type='text'>
So far cache operations are only applied on the submission queue and
completion queue, but they are missing in other places like identify
and block read/write routines.

In order to correctly operate on the caches, the DMA buffer passed
to identify routine must be allocated properly on the stack with the
existing macro ALLOC_CACHE_ALIGN_BUFFER().

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Consolidate block read and write routines</title>
<updated>2017-08-28T11:17:13Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=625a483cea6442da5d435830357c10ecc459f9c6'/>
<id>urn:sha1:625a483cea6442da5d435830357c10ecc459f9c6</id>
<content type='text'>
The NVMe block read and write routines are almost the same except
the command opcode. Let's consolidate them to avoid duplication.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Use macros to access NVMe queues</title>
<updated>2017-08-28T11:17:12Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=722e668db2b4dca735aafcd9ed325145d8a9208c'/>
<id>urn:sha1:722e668db2b4dca735aafcd9ed325145d8a9208c</id>
<content type='text'>
NVMe driver only uses two queues. The first one is allocated to do
admin stuff, while the second one is for IO stuff. So far the driver
uses magic number (0/1) to access them. Change to use macros.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Respect timeout when en/disabling the controller</title>
<updated>2017-08-28T11:17:12Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=04d2a3840110e495a119e6226b5c38936b48988a'/>
<id>urn:sha1:04d2a3840110e495a119e6226b5c38936b48988a</id>
<content type='text'>
So far the driver unconditionally delays 10ms when en/disabling the
controller and still return 0 if 10ms times out. In fact, spec defines
a timeout value in the CAP register that is the worst case time that
host software shall wait for the controller to become ready.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Cache controller's capabilities</title>
<updated>2017-08-28T11:17:11Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b65c6921433c8fcf306b4671f9f9f7c68c36cefc'/>
<id>urn:sha1:b65c6921433c8fcf306b4671f9f9f7c68c36cefc</id>
<content type='text'>
Capabilities register is RO and accessed at various places in the
driver. Let's cache it in the controller driver's priv struct.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Fix endianness assignment to prp2 in nvme_identify()</title>
<updated>2017-08-28T11:17:11Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3e18562961933c7772b7e91ba6fc1e908b453d93'/>
<id>urn:sha1:3e18562961933c7772b7e91ba6fc1e908b453d93</id>
<content type='text'>
So far this is not causing any issue due to NVMe and x86 are using
the same endianness, but for correctness, it should be fixed.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Fix ndev-&gt;queues allocation</title>
<updated>2017-08-28T11:17:11Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=099c2015b02352df9c829acbdc3d8e6e683011a5'/>
<id>urn:sha1:099c2015b02352df9c829acbdc3d8e6e683011a5</id>
<content type='text'>
ndev-&gt;queues is a pointer to pointer, but the allocation wrongly
requests sizeof(struct nvme_queue). Fix it.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme: Fix getting PCI vendor id of the NVMe block device</title>
<updated>2017-08-28T11:17:10Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2017-08-22T15:15:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e5dc2d266539786730eab6cac3c3e26dcb8abc87'/>
<id>urn:sha1:e5dc2d266539786730eab6cac3c3e26dcb8abc87</id>
<content type='text'>
The codes currently try to read PCI vendor id of the NVMe block
device by dm_pci_read_config16() with its parameter set as its
root complex controller (ndev-&gt;pdev) instead of itself. This is
seriously wrong. We can read the vendor id by passing the correct
udevice parameter to the dm_pci_read_config16() API, however there
is a shortcut by reading the cached vendor id from the PCI device's
struct pci_child_platdata.

While we are here fixing this bug, apparently the quirk stuff handle
codes in nvme_get_info_from_identify() never takes effect since its
logic has never been true at all. Remove these codes completely.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
</entry>
</feed>
