New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NVMe disk driver: various improvements #62820
Merged
carlescufi
merged 6 commits into
zephyrproject-rtos:main
from
tbursztyka:nvme_error_mgmt
Sep 22, 2023
Merged
NVMe disk driver: various improvements #62820
carlescufi
merged 6 commits into
zephyrproject-rtos:main
from
tbursztyka:nvme_error_mgmt
Sep 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will provide a detailed error status report. As for most of the original code of the driver, this is a backport of the work done by Jim Harris in FreeBSD. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Getting rid of 4Kib page size hardcoded value on PRP handling. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To avoid issue in address translation when CPU is running in big endian. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Former way was difficult to read, so let's have a better way which easily follows the specifications. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
tbursztyka
force-pushed
the
nvme_error_mgmt
branch
from
September 20, 2023 08:33
8bc7f0a
to
a47b0b8
Compare
tbursztyka
requested review from
carlescufi,
galak and
MaureenHelm
as code owners
September 20, 2023 08:33
This is a specific case for NVMe where given data buffer pointers must be dword (4 bytes) aligned. There is no virtual memory management between the user thread and NVMe driver (which one could detect such wrong alignement on physical memory and thus reallocate the memory properly, so it would be fully transparent for the user thread), thus the need to push that check to the user. This has been going under the radar so far as Qemu does not seem to follow NVMe specifications where PRP1 (in DPTR) must always be dword-aligned. It really does not follow the rule: specifications details that if bits 1:0 of PRP1 are set, the controller may generate an error or treat the address as if these bits were unset. Seems like a bug in Qemu, I did not check the code there however. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
In Zephyr, this is let to the disk access API user. There is nothing the driver can do about it. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
tbursztyka
force-pushed
the
nvme_error_mgmt
branch
from
September 20, 2023 08:35
a47b0b8
to
00d9f42
Compare
tbursztyka
changed the title
NVMe disk driver: various improvments
NVMe disk driver: various improvements
Sep 20, 2023
jfischer-no
approved these changes
Sep 20, 2023
@@ -63,6 +63,9 @@ int disk_access_status(const char *pdrv); | |||
* | |||
* Function to read data from disk to a memory buffer. | |||
* | |||
* Note: if he disk is of NVMe type, user will need to ensure data_buf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: if the disk ?
danieldegrasse
approved these changes
Sep 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Various driver improvements.
Note the 2 last commits which are about data buffer pointer alignment.