Page MenuHomeFreeBSD

D32245.diff
No OneTemporary

D32245.diff

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

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)

Event Timeline