diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/mic/mpssd/mpssd.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c index 0c980ad40b17..4d17487d5ad9 100644 --- a/Documentation/mic/mpssd/mpssd.c +++ b/Documentation/mic/mpssd/mpssd.c | |||
@@ -313,7 +313,7 @@ static struct mic_device_desc *get_device_desc(struct mic_info *mic, int type) | |||
313 | int i; | 313 | int i; |
314 | void *dp = get_dp(mic, type); | 314 | void *dp = get_dp(mic, type); |
315 | 315 | ||
316 | for (i = mic_aligned_size(struct mic_bootparam); i < PAGE_SIZE; | 316 | for (i = sizeof(struct mic_bootparam); i < PAGE_SIZE; |
317 | i += mic_total_desc_size(d)) { | 317 | i += mic_total_desc_size(d)) { |
318 | d = dp + i; | 318 | d = dp + i; |
319 | 319 | ||
@@ -445,8 +445,8 @@ init_vr(struct mic_info *mic, int fd, int type, | |||
445 | __func__, mic->name, vr0->va, vr0->info, vr_size, | 445 | __func__, mic->name, vr0->va, vr0->info, vr_size, |
446 | vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN)); | 446 | vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN)); |
447 | mpsslog("magic 0x%x expected 0x%x\n", | 447 | mpsslog("magic 0x%x expected 0x%x\n", |
448 | vr0->info->magic, MIC_MAGIC + type); | 448 | le32toh(vr0->info->magic), MIC_MAGIC + type); |
449 | assert(vr0->info->magic == MIC_MAGIC + type); | 449 | assert(le32toh(vr0->info->magic) == MIC_MAGIC + type); |
450 | if (vr1) { | 450 | if (vr1) { |
451 | vr1->va = (struct mic_vring *) | 451 | vr1->va = (struct mic_vring *) |
452 | &va[MIC_DEVICE_PAGE_END + vr_size]; | 452 | &va[MIC_DEVICE_PAGE_END + vr_size]; |
@@ -458,8 +458,8 @@ init_vr(struct mic_info *mic, int fd, int type, | |||
458 | __func__, mic->name, vr1->va, vr1->info, vr_size, | 458 | __func__, mic->name, vr1->va, vr1->info, vr_size, |
459 | vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN)); | 459 | vring_size(MIC_VRING_ENTRIES, MIC_VIRTIO_RING_ALIGN)); |
460 | mpsslog("magic 0x%x expected 0x%x\n", | 460 | mpsslog("magic 0x%x expected 0x%x\n", |
461 | vr1->info->magic, MIC_MAGIC + type + 1); | 461 | le32toh(vr1->info->magic), MIC_MAGIC + type + 1); |
462 | assert(vr1->info->magic == MIC_MAGIC + type + 1); | 462 | assert(le32toh(vr1->info->magic) == MIC_MAGIC + type + 1); |
463 | } | 463 | } |
464 | done: | 464 | done: |
465 | return va; | 465 | return va; |
@@ -520,7 +520,7 @@ static void * | |||
520 | virtio_net(void *arg) | 520 | virtio_net(void *arg) |
521 | { | 521 | { |
522 | static __u8 vnet_hdr[2][sizeof(struct virtio_net_hdr)]; | 522 | static __u8 vnet_hdr[2][sizeof(struct virtio_net_hdr)]; |
523 | static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __aligned(64); | 523 | static __u8 vnet_buf[2][MAX_NET_PKT_SIZE] __attribute__ ((aligned(64))); |
524 | struct iovec vnet_iov[2][2] = { | 524 | struct iovec vnet_iov[2][2] = { |
525 | { { .iov_base = vnet_hdr[0], .iov_len = sizeof(vnet_hdr[0]) }, | 525 | { { .iov_base = vnet_hdr[0], .iov_len = sizeof(vnet_hdr[0]) }, |
526 | { .iov_base = vnet_buf[0], .iov_len = sizeof(vnet_buf[0]) } }, | 526 | { .iov_base = vnet_buf[0], .iov_len = sizeof(vnet_buf[0]) } }, |
@@ -1412,6 +1412,12 @@ mic_config(void *arg) | |||
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | do { | 1414 | do { |
1415 | ret = lseek(fd, 0, SEEK_SET); | ||
1416 | if (ret < 0) { | ||
1417 | mpsslog("%s: Failed to seek to file start '%s': %s\n", | ||
1418 | mic->name, pathname, strerror(errno)); | ||
1419 | goto close_error1; | ||
1420 | } | ||
1415 | ret = read(fd, value, sizeof(value)); | 1421 | ret = read(fd, value, sizeof(value)); |
1416 | if (ret < 0) { | 1422 | if (ret < 0) { |
1417 | mpsslog("%s: Failed to read sysfs entry '%s': %s\n", | 1423 | mpsslog("%s: Failed to read sysfs entry '%s': %s\n", |