aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/mic
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/mic')
-rw-r--r--Documentation/mic/mic_overview.txt4
-rw-r--r--Documentation/mic/mpssd/mpssd.c27
-rw-r--r--Documentation/mic/mpssd/mpssd.h1
3 files changed, 27 insertions, 5 deletions
diff --git a/Documentation/mic/mic_overview.txt b/Documentation/mic/mic_overview.txt
index c4424ed1b746..b41929224804 100644
--- a/Documentation/mic/mic_overview.txt
+++ b/Documentation/mic/mic_overview.txt
@@ -4,7 +4,9 @@ that runs a Linux OS. It is a PCIe endpoint in a platform and therefore
4implements the three required standard address spaces i.e. configuration, 4implements the three required standard address spaces i.e. configuration,
5memory and I/O. The host OS loads a device driver as is typical for 5memory and I/O. The host OS loads a device driver as is typical for
6PCIe devices. The card itself runs a bootstrap after reset that 6PCIe devices. The card itself runs a bootstrap after reset that
7transfers control to the card OS downloaded from the host driver. 7transfers control to the card OS downloaded from the host driver. The
8host driver supports OSPM suspend and resume operations. It shuts down
9the card during suspend and reboots the card OS during resume.
8The card OS as shipped by Intel is a Linux kernel with modifications 10The card OS as shipped by Intel is a Linux kernel with modifications
9for the X100 devices. 11for the X100 devices.
10 12
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c
index 82c6bc2e3cb6..0c980ad40b17 100644
--- a/Documentation/mic/mpssd/mpssd.c
+++ b/Documentation/mic/mpssd/mpssd.c
@@ -1295,7 +1295,13 @@ reset(struct mic_info *mic)
1295 goto retry; 1295 goto retry;
1296 mpsslog("%s: %s %d state %s\n", 1296 mpsslog("%s: %s %d state %s\n",
1297 mic->name, __func__, __LINE__, state); 1297 mic->name, __func__, __LINE__, state);
1298 if ((!strcmp(state, "offline"))) { 1298
1299 /*
1300 * If the shutdown was initiated by OSPM, the state stays
1301 * in "suspended" which is also a valid condition for reset.
1302 */
1303 if ((!strcmp(state, "offline")) ||
1304 (!strcmp(state, "suspended"))) {
1299 free(state); 1305 free(state);
1300 break; 1306 break;
1301 } 1307 }
@@ -1334,6 +1340,10 @@ static int get_mic_state(struct mic_info *mic, char *state)
1334 return MIC_SHUTTING_DOWN; 1340 return MIC_SHUTTING_DOWN;
1335 if (!strcmp(state, "reset_failed")) 1341 if (!strcmp(state, "reset_failed"))
1336 return MIC_RESET_FAILED; 1342 return MIC_RESET_FAILED;
1343 if (!strcmp(state, "suspending"))
1344 return MIC_SUSPENDING;
1345 if (!strcmp(state, "suspended"))
1346 return MIC_SUSPENDED;
1337 mpsslog("%s: BUG invalid state %s\n", mic->name, state); 1347 mpsslog("%s: BUG invalid state %s\n", mic->name, state);
1338 /* Invalid state */ 1348 /* Invalid state */
1339 assert(0); 1349 assert(0);
@@ -1418,6 +1428,17 @@ retry:
1418 case MIC_SHUTTING_DOWN: 1428 case MIC_SHUTTING_DOWN:
1419 mic_handle_shutdown(mic); 1429 mic_handle_shutdown(mic);
1420 goto close_error; 1430 goto close_error;
1431 case MIC_SUSPENDING:
1432 mic->boot_on_resume = 1;
1433 setsysfs(mic->name, "state", "suspend");
1434 mic_handle_shutdown(mic);
1435 goto close_error;
1436 case MIC_OFFLINE:
1437 if (mic->boot_on_resume) {
1438 setsysfs(mic->name, "state", "boot");
1439 mic->boot_on_resume = 0;
1440 }
1441 break;
1421 default: 1442 default:
1422 break; 1443 break;
1423 } 1444 }
@@ -1621,11 +1642,9 @@ init_mic_list(void)
1621 1642
1622 while ((file = readdir(dp)) != NULL) { 1643 while ((file = readdir(dp)) != NULL) {
1623 if (!strncmp(file->d_name, "mic", 3)) { 1644 if (!strncmp(file->d_name, "mic", 3)) {
1624 mic->next = malloc(sizeof(struct mic_info)); 1645 mic->next = calloc(1, sizeof(struct mic_info));
1625 if (mic->next) { 1646 if (mic->next) {
1626 mic = mic->next; 1647 mic = mic->next;
1627 mic->next = NULL;
1628 memset(mic, 0, sizeof(struct mic_info));
1629 mic->id = atoi(&file->d_name[3]); 1648 mic->id = atoi(&file->d_name[3]);
1630 mic->name = malloc(strlen(file->d_name) + 16); 1649 mic->name = malloc(strlen(file->d_name) + 16);
1631 if (mic->name) 1650 if (mic->name)
diff --git a/Documentation/mic/mpssd/mpssd.h b/Documentation/mic/mpssd/mpssd.h
index ccd589ff9146..f5f18b15d9a0 100644
--- a/Documentation/mic/mpssd/mpssd.h
+++ b/Documentation/mic/mpssd/mpssd.h
@@ -91,6 +91,7 @@ struct mic_info {
91 struct mic_net_info mic_net; 91 struct mic_net_info mic_net;
92 struct mic_virtblk_info mic_virtblk; 92 struct mic_virtblk_info mic_virtblk;
93 int restart; 93 int restart;
94 int boot_on_resume;
94 struct mic_info *next; 95 struct mic_info *next;
95}; 96};
96 97