Commit 9bccfd01c618a5d059f332c000c42e5bf39880d9
1 parent
8cca3efba0
Exists in
smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga
and in
5 other branches
MLK-14930-1 cmd: sata: Fix sata init and stop issue
When sata stop is executed, the sata_curr_device is not reset to -1, so any following sata commands will not initialize the sata again and cause problem. Additional, in sata init implementation, the sata_curr_device should be updated, otherwise sata will be initialized again when doing other sata commands like read/write/info/part/device. Signed-off-by: Ye Li <ye.li@nxp.com>
Showing 1 changed file with 8 additions and 2 deletions Side-by-side Diff
cmd/sata.c
... | ... | @@ -91,8 +91,10 @@ |
91 | 91 | |
92 | 92 | if (argc == 3) |
93 | 93 | devnum = (int)simple_strtoul(argv[2], NULL, 10); |
94 | - if (!strcmp(argv[1], "stop")) | |
94 | + if (!strcmp(argv[1], "stop")) { | |
95 | + sata_curr_device = -1; | |
95 | 96 | return sata_remove(devnum); |
97 | + } | |
96 | 98 | |
97 | 99 | if (!strcmp(argv[1], "init")) { |
98 | 100 | if (sata_curr_device != -1) { |
... | ... | @@ -101,7 +103,11 @@ |
101 | 103 | return rc; |
102 | 104 | } |
103 | 105 | |
104 | - return sata_probe(devnum); | |
106 | + rc = sata_probe(devnum); | |
107 | + if (rc < 0) | |
108 | + return CMD_RET_FAILURE; | |
109 | + sata_curr_device = rc; | |
110 | + return CMD_RET_SUCCESS; | |
105 | 111 | } |
106 | 112 | } |
107 | 113 |
-
mentioned in commit f162bb
-
mentioned in commit f162bb
-
mentioned in commit aefaf1
-
mentioned in commit aefaf1
-
mentioned in commit aefaf1
-
mentioned in commit aefaf1
-
mentioned in commit 1707f0
-
mentioned in commit 1707f0
-
mentioned in commit aefaf1
-
mentioned in commit 1707f0
-
mentioned in commit 1707f0
-
mentioned in commit 1707f0
-
mentioned in commit 1707f0
-
mentioned in commit 0aebdc