Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04cbd06

Browse filesBrowse files
authored
Merge pull request #1698 from seijikun/mr-disk-ioalign-fix
uefi: Fix io-align == 0 edgecase handling for ata & nvme
2 parents a8b8b61 + d6e7bb5 commit 04cbd06
Copy full SHA for 04cbd06

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed

‎uefi/src/proto/ata/pass_thru.rs

Copy file name to clipboardExpand all lines: uefi/src/proto/ata/pass_thru.rs
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ impl AtaPassThru {
4242
/// The [`AtaPassThruMode`] structure containing configuration details of the protocol.
4343
#[must_use]
4444
pub fn mode(&self) -> AtaPassThruMode {
45-
unsafe { (*self.0.mode).clone() }
45+
let mut mode = unsafe { (*self.0.mode).clone() };
46+
mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec
47+
mode
4648
}
4749

4850
/// Retrieves the I/O buffer alignment required by this SCSI channel.

‎uefi/src/proto/nvme/pass_thru.rs

Copy file name to clipboardExpand all lines: uefi/src/proto/nvme/pass_thru.rs
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ impl NvmePassThru {
4949
/// An instance of [`NvmePassThruMode`] describing the NVMe controller's capabilities.
5050
#[must_use]
5151
pub fn mode(&self) -> NvmePassThruMode {
52-
unsafe { (*self.0.mode).clone() }
52+
let mut mode = unsafe { (*self.0.mode).clone() };
53+
mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec
54+
mode
5355
}
5456

5557
/// Retrieves the alignment requirements for I/O buffers.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.