Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107723189
D32245.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32245.diff
View Options
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -303,19 +303,17 @@
* CSTS.RDY is 0 "has undefined results" So make sure that CSTS.RDY
* isn't the desired value. Short circuit if we're already disabled.
*/
- if (en == 1) {
- if (rdy == 0) {
- /* EN == 1, wait for RDY == 1 or fail */
- err = nvme_ctrlr_wait_for_ready(ctrlr, 1);
- if (err != 0)
- return (err);
- }
- } else {
- /* EN == 0 already wait for RDY == 0 */
+ if (en == 0) {
+ /* Wait for RDY == 0 or timeout & fail */
if (rdy == 0)
return (0);
- else
- return (nvme_ctrlr_wait_for_ready(ctrlr, 0));
+ return (nvme_ctrlr_wait_for_ready(ctrlr, 0));
+ }
+ if (rdy == 0) {
+ /* EN == 1, wait for RDY == 1 or timeout & fail */
+ err = nvme_ctrlr_wait_for_ready(ctrlr, 1);
+ if (err != 0)
+ return (err);
}
cc &= ~NVME_CC_REG_EN_MASK;
@@ -352,15 +350,14 @@
if (en == 1) {
if (rdy == 1)
return (0);
- else
- return (nvme_ctrlr_wait_for_ready(ctrlr, 1));
- } else {
- /* EN == 0 already wait for RDY == 0 or fail */
- err = nvme_ctrlr_wait_for_ready(ctrlr, 0);
- if (err != 0)
- return (err);
+ return (nvme_ctrlr_wait_for_ready(ctrlr, 1));
}
+ /* EN == 0 already wait for RDY == 0 or timeout & fail */
+ err = nvme_ctrlr_wait_for_ready(ctrlr, 0);
+ if (err != 0)
+ return (err);
+
nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr);
nvme_mmio_write_8(ctrlr, acq, ctrlr->adminq.cpl_bus_addr);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 7:28 PM (20 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15886208
Default Alt Text
D32245.diff (1 KB)
Attached To
Mode
D32245: nvme_ctrlr_enable: Small style nits
Attached
Detach File
Event Timeline
Log In to Comment