diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/enclosure.c | 7 | ||||
-rw-r--r-- | drivers/misc/mei/hw-me-regs.h | 5 | ||||
-rw-r--r-- | drivers/misc/mei/pci-me.c | 4 | ||||
-rw-r--r-- | drivers/misc/mic/card/mic_virtio.c | 33 | ||||
-rw-r--r-- | drivers/misc/mic/card/mic_virtio.h | 7 | ||||
-rw-r--r-- | drivers/misc/mic/host/mic_boot.c | 2 | ||||
-rw-r--r-- | drivers/misc/mic/host/mic_virtio.c | 30 | ||||
-rw-r--r-- | drivers/misc/mic/host/mic_x100.c | 4 |
8 files changed, 53 insertions, 39 deletions
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 0e8df41aaf14..2cf2bbc0b927 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c | |||
@@ -198,6 +198,13 @@ static void enclosure_remove_links(struct enclosure_component *cdev) | |||
198 | { | 198 | { |
199 | char name[ENCLOSURE_NAME_SIZE]; | 199 | char name[ENCLOSURE_NAME_SIZE]; |
200 | 200 | ||
201 | /* | ||
202 | * In odd circumstances, like multipath devices, something else may | ||
203 | * already have removed the links, so check for this condition first. | ||
204 | */ | ||
205 | if (!cdev->dev->kobj.sd) | ||
206 | return; | ||
207 | |||
201 | enclosure_link_name(cdev, name); | 208 | enclosure_link_name(cdev, name); |
202 | sysfs_remove_link(&cdev->dev->kobj, name); | 209 | sysfs_remove_link(&cdev->dev->kobj, name); |
203 | sysfs_remove_link(&cdev->cdev.kobj, "device"); | 210 | sysfs_remove_link(&cdev->cdev.kobj, "device"); |
diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h index 6c0fde55270d..66f411a6e8ea 100644 --- a/drivers/misc/mei/hw-me-regs.h +++ b/drivers/misc/mei/hw-me-regs.h | |||
@@ -109,9 +109,12 @@ | |||
109 | #define MEI_DEV_ID_PPT_2 0x1CBA /* Panther Point */ | 109 | #define MEI_DEV_ID_PPT_2 0x1CBA /* Panther Point */ |
110 | #define MEI_DEV_ID_PPT_3 0x1DBA /* Panther Point */ | 110 | #define MEI_DEV_ID_PPT_3 0x1DBA /* Panther Point */ |
111 | 111 | ||
112 | #define MEI_DEV_ID_LPT 0x8C3A /* Lynx Point */ | 112 | #define MEI_DEV_ID_LPT_H 0x8C3A /* Lynx Point H */ |
113 | #define MEI_DEV_ID_LPT_W 0x8D3A /* Lynx Point - Wellsburg */ | 113 | #define MEI_DEV_ID_LPT_W 0x8D3A /* Lynx Point - Wellsburg */ |
114 | #define MEI_DEV_ID_LPT_LP 0x9C3A /* Lynx Point LP */ | 114 | #define MEI_DEV_ID_LPT_LP 0x9C3A /* Lynx Point LP */ |
115 | #define MEI_DEV_ID_LPT_HR 0x8CBA /* Lynx Point H Refresh */ | ||
116 | |||
117 | #define MEI_DEV_ID_WPT_LP 0x9CBA /* Wildcat Point LP */ | ||
115 | /* | 118 | /* |
116 | * MEI HW Section | 119 | * MEI HW Section |
117 | */ | 120 | */ |
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index b96205aece0c..2cab3c0a6805 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -76,9 +76,11 @@ static DEFINE_PCI_DEVICE_TABLE(mei_me_pci_tbl) = { | |||
76 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_1)}, | 76 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_1)}, |
77 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_2)}, | 77 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_2)}, |
78 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_3)}, | 78 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_PPT_3)}, |
79 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT)}, | 79 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_H)}, |
80 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_W)}, | 80 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_W)}, |
81 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_LP)}, | 81 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_LP)}, |
82 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_LPT_HR)}, | ||
83 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MEI_DEV_ID_WPT_LP)}, | ||
82 | 84 | ||
83 | /* required last entry */ | 85 | /* required last entry */ |
84 | {0, } | 86 | {0, } |
diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c index 8aa42e738acc..653799b96bfa 100644 --- a/drivers/misc/mic/card/mic_virtio.c +++ b/drivers/misc/mic/card/mic_virtio.c | |||
@@ -154,14 +154,14 @@ static void mic_reset_inform_host(struct virtio_device *vdev) | |||
154 | { | 154 | { |
155 | struct mic_vdev *mvdev = to_micvdev(vdev); | 155 | struct mic_vdev *mvdev = to_micvdev(vdev); |
156 | struct mic_device_ctrl __iomem *dc = mvdev->dc; | 156 | struct mic_device_ctrl __iomem *dc = mvdev->dc; |
157 | int retry = 100, i; | 157 | int retry; |
158 | 158 | ||
159 | iowrite8(0, &dc->host_ack); | 159 | iowrite8(0, &dc->host_ack); |
160 | iowrite8(1, &dc->vdev_reset); | 160 | iowrite8(1, &dc->vdev_reset); |
161 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); | 161 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); |
162 | 162 | ||
163 | /* Wait till host completes all card accesses and acks the reset */ | 163 | /* Wait till host completes all card accesses and acks the reset */ |
164 | for (i = retry; i--;) { | 164 | for (retry = 100; retry--;) { |
165 | if (ioread8(&dc->host_ack)) | 165 | if (ioread8(&dc->host_ack)) |
166 | break; | 166 | break; |
167 | msleep(100); | 167 | msleep(100); |
@@ -187,11 +187,12 @@ static void mic_reset(struct virtio_device *vdev) | |||
187 | /* | 187 | /* |
188 | * The virtio_ring code calls this API when it wants to notify the Host. | 188 | * The virtio_ring code calls this API when it wants to notify the Host. |
189 | */ | 189 | */ |
190 | static void mic_notify(struct virtqueue *vq) | 190 | static bool mic_notify(struct virtqueue *vq) |
191 | { | 191 | { |
192 | struct mic_vdev *mvdev = vq->priv; | 192 | struct mic_vdev *mvdev = vq->priv; |
193 | 193 | ||
194 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); | 194 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); |
195 | return true; | ||
195 | } | 196 | } |
196 | 197 | ||
197 | static void mic_del_vq(struct virtqueue *vq, int n) | 198 | static void mic_del_vq(struct virtqueue *vq, int n) |
@@ -247,17 +248,17 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev, | |||
247 | /* First assign the vring's allocated in host memory */ | 248 | /* First assign the vring's allocated in host memory */ |
248 | vqconfig = mic_vq_config(mvdev->desc) + index; | 249 | vqconfig = mic_vq_config(mvdev->desc) + index; |
249 | memcpy_fromio(&config, vqconfig, sizeof(config)); | 250 | memcpy_fromio(&config, vqconfig, sizeof(config)); |
250 | _vr_size = vring_size(config.num, MIC_VIRTIO_RING_ALIGN); | 251 | _vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN); |
251 | vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info)); | 252 | vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info)); |
252 | va = mic_card_map(mvdev->mdev, config.address, vr_size); | 253 | va = mic_card_map(mvdev->mdev, le64_to_cpu(config.address), vr_size); |
253 | if (!va) | 254 | if (!va) |
254 | return ERR_PTR(-ENOMEM); | 255 | return ERR_PTR(-ENOMEM); |
255 | mvdev->vr[index] = va; | 256 | mvdev->vr[index] = va; |
256 | memset_io(va, 0x0, _vr_size); | 257 | memset_io(va, 0x0, _vr_size); |
257 | vq = vring_new_virtqueue(index, | 258 | vq = vring_new_virtqueue(index, le16_to_cpu(config.num), |
258 | config.num, MIC_VIRTIO_RING_ALIGN, vdev, | 259 | MIC_VIRTIO_RING_ALIGN, vdev, false, |
259 | false, | 260 | (void __force *)va, mic_notify, callback, |
260 | va, mic_notify, callback, name); | 261 | name); |
261 | if (!vq) { | 262 | if (!vq) { |
262 | err = -ENOMEM; | 263 | err = -ENOMEM; |
263 | goto unmap; | 264 | goto unmap; |
@@ -272,7 +273,8 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev, | |||
272 | 273 | ||
273 | /* Allocate and reassign used ring now */ | 274 | /* Allocate and reassign used ring now */ |
274 | mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 + | 275 | mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 + |
275 | sizeof(struct vring_used_elem) * config.num); | 276 | sizeof(struct vring_used_elem) * |
277 | le16_to_cpu(config.num)); | ||
276 | used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, | 278 | used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, |
277 | get_order(mvdev->used_size[index])); | 279 | get_order(mvdev->used_size[index])); |
278 | if (!used) { | 280 | if (!used) { |
@@ -309,7 +311,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs, | |||
309 | { | 311 | { |
310 | struct mic_vdev *mvdev = to_micvdev(vdev); | 312 | struct mic_vdev *mvdev = to_micvdev(vdev); |
311 | struct mic_device_ctrl __iomem *dc = mvdev->dc; | 313 | struct mic_device_ctrl __iomem *dc = mvdev->dc; |
312 | int i, err, retry = 100; | 314 | int i, err, retry; |
313 | 315 | ||
314 | /* We must have this many virtqueues. */ | 316 | /* We must have this many virtqueues. */ |
315 | if (nvqs > ioread8(&mvdev->desc->num_vq)) | 317 | if (nvqs > ioread8(&mvdev->desc->num_vq)) |
@@ -331,7 +333,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs, | |||
331 | * rings have been re-assigned. | 333 | * rings have been re-assigned. |
332 | */ | 334 | */ |
333 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); | 335 | mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); |
334 | for (i = retry; i--;) { | 336 | for (retry = 100; retry--;) { |
335 | if (!ioread8(&dc->used_address_updated)) | 337 | if (!ioread8(&dc->used_address_updated)) |
336 | break; | 338 | break; |
337 | msleep(100); | 339 | msleep(100); |
@@ -519,8 +521,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove) | |||
519 | struct device *dev; | 521 | struct device *dev; |
520 | int ret; | 522 | int ret; |
521 | 523 | ||
522 | for (i = mic_aligned_size(struct mic_bootparam); | 524 | for (i = sizeof(struct mic_bootparam); i < MIC_DP_SIZE; |
523 | i < MIC_DP_SIZE; i += mic_total_desc_size(d)) { | 525 | i += mic_total_desc_size(d)) { |
524 | d = mdrv->dp + i; | 526 | d = mdrv->dp + i; |
525 | dc = (void __iomem *)d + mic_aligned_desc_size(d); | 527 | dc = (void __iomem *)d + mic_aligned_desc_size(d); |
526 | /* | 528 | /* |
@@ -539,7 +541,8 @@ static void mic_scan_devices(struct mic_driver *mdrv, bool remove) | |||
539 | continue; | 541 | continue; |
540 | 542 | ||
541 | /* device already exists */ | 543 | /* device already exists */ |
542 | dev = device_find_child(mdrv->dev, d, mic_match_desc); | 544 | dev = device_find_child(mdrv->dev, (void __force *)d, |
545 | mic_match_desc); | ||
543 | if (dev) { | 546 | if (dev) { |
544 | if (remove) | 547 | if (remove) |
545 | iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE, | 548 | iowrite8(MIC_VIRTIO_PARAM_DEV_REMOVE, |
diff --git a/drivers/misc/mic/card/mic_virtio.h b/drivers/misc/mic/card/mic_virtio.h index 2c5c22c93ba8..d0407ba53bb7 100644 --- a/drivers/misc/mic/card/mic_virtio.h +++ b/drivers/misc/mic/card/mic_virtio.h | |||
@@ -42,8 +42,8 @@ | |||
42 | 42 | ||
43 | static inline unsigned mic_desc_size(struct mic_device_desc __iomem *desc) | 43 | static inline unsigned mic_desc_size(struct mic_device_desc __iomem *desc) |
44 | { | 44 | { |
45 | return mic_aligned_size(*desc) | 45 | return sizeof(*desc) |
46 | + ioread8(&desc->num_vq) * mic_aligned_size(struct mic_vqconfig) | 46 | + ioread8(&desc->num_vq) * sizeof(struct mic_vqconfig) |
47 | + ioread8(&desc->feature_len) * 2 | 47 | + ioread8(&desc->feature_len) * 2 |
48 | + ioread8(&desc->config_len); | 48 | + ioread8(&desc->config_len); |
49 | } | 49 | } |
@@ -67,8 +67,7 @@ mic_vq_configspace(struct mic_device_desc __iomem *desc) | |||
67 | } | 67 | } |
68 | static inline unsigned mic_total_desc_size(struct mic_device_desc __iomem *desc) | 68 | static inline unsigned mic_total_desc_size(struct mic_device_desc __iomem *desc) |
69 | { | 69 | { |
70 | return mic_aligned_desc_size(desc) + | 70 | return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl); |
71 | mic_aligned_size(struct mic_device_ctrl); | ||
72 | } | 71 | } |
73 | 72 | ||
74 | int mic_devices_init(struct mic_driver *mdrv); | 73 | int mic_devices_init(struct mic_driver *mdrv); |
diff --git a/drivers/misc/mic/host/mic_boot.c b/drivers/misc/mic/host/mic_boot.c index 7558d9186438..b75c6b5cc20f 100644 --- a/drivers/misc/mic/host/mic_boot.c +++ b/drivers/misc/mic/host/mic_boot.c | |||
@@ -62,7 +62,7 @@ void mic_bootparam_init(struct mic_device *mdev) | |||
62 | { | 62 | { |
63 | struct mic_bootparam *bootparam = mdev->dp; | 63 | struct mic_bootparam *bootparam = mdev->dp; |
64 | 64 | ||
65 | bootparam->magic = MIC_MAGIC; | 65 | bootparam->magic = cpu_to_le32(MIC_MAGIC); |
66 | bootparam->c2h_shutdown_db = mdev->shutdown_db; | 66 | bootparam->c2h_shutdown_db = mdev->shutdown_db; |
67 | bootparam->h2c_shutdown_db = -1; | 67 | bootparam->h2c_shutdown_db = -1; |
68 | bootparam->h2c_config_db = -1; | 68 | bootparam->h2c_config_db = -1; |
diff --git a/drivers/misc/mic/host/mic_virtio.c b/drivers/misc/mic/host/mic_virtio.c index 5b8494bd1e00..e04bb4fe6823 100644 --- a/drivers/misc/mic/host/mic_virtio.c +++ b/drivers/misc/mic/host/mic_virtio.c | |||
@@ -41,7 +41,7 @@ static int mic_virtio_copy_to_user(struct mic_vdev *mvdev, | |||
41 | * We are copying from IO below an should ideally use something | 41 | * We are copying from IO below an should ideally use something |
42 | * like copy_to_user_fromio(..) if it existed. | 42 | * like copy_to_user_fromio(..) if it existed. |
43 | */ | 43 | */ |
44 | if (copy_to_user(ubuf, dbuf, len)) { | 44 | if (copy_to_user(ubuf, (void __force *)dbuf, len)) { |
45 | err = -EFAULT; | 45 | err = -EFAULT; |
46 | dev_err(mic_dev(mvdev), "%s %d err %d\n", | 46 | dev_err(mic_dev(mvdev), "%s %d err %d\n", |
47 | __func__, __LINE__, err); | 47 | __func__, __LINE__, err); |
@@ -66,7 +66,7 @@ static int mic_virtio_copy_from_user(struct mic_vdev *mvdev, | |||
66 | * We are copying to IO below and should ideally use something | 66 | * We are copying to IO below and should ideally use something |
67 | * like copy_from_user_toio(..) if it existed. | 67 | * like copy_from_user_toio(..) if it existed. |
68 | */ | 68 | */ |
69 | if (copy_from_user(dbuf, ubuf, len)) { | 69 | if (copy_from_user((void __force *)dbuf, ubuf, len)) { |
70 | err = -EFAULT; | 70 | err = -EFAULT; |
71 | dev_err(mic_dev(mvdev), "%s %d err %d\n", | 71 | dev_err(mic_dev(mvdev), "%s %d err %d\n", |
72 | __func__, __LINE__, err); | 72 | __func__, __LINE__, err); |
@@ -293,7 +293,7 @@ static void mic_virtio_init_post(struct mic_vdev *mvdev) | |||
293 | continue; | 293 | continue; |
294 | } | 294 | } |
295 | mvdev->mvr[i].vrh.vring.used = | 295 | mvdev->mvr[i].vrh.vring.used = |
296 | mvdev->mdev->aper.va + | 296 | (void __force *)mvdev->mdev->aper.va + |
297 | le64_to_cpu(vqconfig[i].used_address); | 297 | le64_to_cpu(vqconfig[i].used_address); |
298 | } | 298 | } |
299 | 299 | ||
@@ -378,7 +378,7 @@ int mic_virtio_config_change(struct mic_vdev *mvdev, | |||
378 | void __user *argp) | 378 | void __user *argp) |
379 | { | 379 | { |
380 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake); | 380 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake); |
381 | int ret = 0, retry = 100, i; | 381 | int ret = 0, retry, i; |
382 | struct mic_bootparam *bootparam = mvdev->mdev->dp; | 382 | struct mic_bootparam *bootparam = mvdev->mdev->dp; |
383 | s8 db = bootparam->h2c_config_db; | 383 | s8 db = bootparam->h2c_config_db; |
384 | 384 | ||
@@ -401,7 +401,7 @@ int mic_virtio_config_change(struct mic_vdev *mvdev, | |||
401 | mvdev->dc->config_change = MIC_VIRTIO_PARAM_CONFIG_CHANGED; | 401 | mvdev->dc->config_change = MIC_VIRTIO_PARAM_CONFIG_CHANGED; |
402 | mvdev->mdev->ops->send_intr(mvdev->mdev, db); | 402 | mvdev->mdev->ops->send_intr(mvdev->mdev, db); |
403 | 403 | ||
404 | for (i = retry; i--;) { | 404 | for (retry = 100; retry--;) { |
405 | ret = wait_event_timeout(wake, | 405 | ret = wait_event_timeout(wake, |
406 | mvdev->dc->guest_ack, msecs_to_jiffies(100)); | 406 | mvdev->dc->guest_ack, msecs_to_jiffies(100)); |
407 | if (ret) | 407 | if (ret) |
@@ -467,7 +467,7 @@ static int mic_copy_dp_entry(struct mic_vdev *mvdev, | |||
467 | } | 467 | } |
468 | 468 | ||
469 | /* Find the first free device page entry */ | 469 | /* Find the first free device page entry */ |
470 | for (i = mic_aligned_size(struct mic_bootparam); | 470 | for (i = sizeof(struct mic_bootparam); |
471 | i < MIC_DP_SIZE - mic_total_desc_size(dd_config); | 471 | i < MIC_DP_SIZE - mic_total_desc_size(dd_config); |
472 | i += mic_total_desc_size(devp)) { | 472 | i += mic_total_desc_size(devp)) { |
473 | devp = mdev->dp + i; | 473 | devp = mdev->dp + i; |
@@ -525,6 +525,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev, | |||
525 | char irqname[10]; | 525 | char irqname[10]; |
526 | struct mic_bootparam *bootparam = mdev->dp; | 526 | struct mic_bootparam *bootparam = mdev->dp; |
527 | u16 num; | 527 | u16 num; |
528 | dma_addr_t vr_addr; | ||
528 | 529 | ||
529 | mutex_lock(&mdev->mic_mutex); | 530 | mutex_lock(&mdev->mic_mutex); |
530 | 531 | ||
@@ -559,17 +560,16 @@ int mic_virtio_add_device(struct mic_vdev *mvdev, | |||
559 | } | 560 | } |
560 | vr->len = vr_size; | 561 | vr->len = vr_size; |
561 | vr->info = vr->va + vring_size(num, MIC_VIRTIO_RING_ALIGN); | 562 | vr->info = vr->va + vring_size(num, MIC_VIRTIO_RING_ALIGN); |
562 | vr->info->magic = MIC_MAGIC + mvdev->virtio_id + i; | 563 | vr->info->magic = cpu_to_le32(MIC_MAGIC + mvdev->virtio_id + i); |
563 | vqconfig[i].address = mic_map_single(mdev, | 564 | vr_addr = mic_map_single(mdev, vr->va, vr_size); |
564 | vr->va, vr_size); | 565 | if (mic_map_error(vr_addr)) { |
565 | if (mic_map_error(vqconfig[i].address)) { | ||
566 | free_pages((unsigned long)vr->va, get_order(vr_size)); | 566 | free_pages((unsigned long)vr->va, get_order(vr_size)); |
567 | ret = -ENOMEM; | 567 | ret = -ENOMEM; |
568 | dev_err(mic_dev(mvdev), "%s %d err %d\n", | 568 | dev_err(mic_dev(mvdev), "%s %d err %d\n", |
569 | __func__, __LINE__, ret); | 569 | __func__, __LINE__, ret); |
570 | goto err; | 570 | goto err; |
571 | } | 571 | } |
572 | vqconfig[i].address = cpu_to_le64(vqconfig[i].address); | 572 | vqconfig[i].address = cpu_to_le64(vr_addr); |
573 | 573 | ||
574 | vring_init(&vr->vr, num, vr->va, MIC_VIRTIO_RING_ALIGN); | 574 | vring_init(&vr->vr, num, vr->va, MIC_VIRTIO_RING_ALIGN); |
575 | ret = vringh_init_kern(&mvr->vrh, | 575 | ret = vringh_init_kern(&mvr->vrh, |
@@ -639,7 +639,7 @@ void mic_virtio_del_device(struct mic_vdev *mvdev) | |||
639 | struct mic_vdev *tmp_mvdev; | 639 | struct mic_vdev *tmp_mvdev; |
640 | struct mic_device *mdev = mvdev->mdev; | 640 | struct mic_device *mdev = mvdev->mdev; |
641 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake); | 641 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake); |
642 | int i, ret, retry = 100; | 642 | int i, ret, retry; |
643 | struct mic_vqconfig *vqconfig; | 643 | struct mic_vqconfig *vqconfig; |
644 | struct mic_bootparam *bootparam = mdev->dp; | 644 | struct mic_bootparam *bootparam = mdev->dp; |
645 | s8 db; | 645 | s8 db; |
@@ -652,16 +652,16 @@ void mic_virtio_del_device(struct mic_vdev *mvdev) | |||
652 | "Requesting hot remove id %d\n", mvdev->virtio_id); | 652 | "Requesting hot remove id %d\n", mvdev->virtio_id); |
653 | mvdev->dc->config_change = MIC_VIRTIO_PARAM_DEV_REMOVE; | 653 | mvdev->dc->config_change = MIC_VIRTIO_PARAM_DEV_REMOVE; |
654 | mdev->ops->send_intr(mdev, db); | 654 | mdev->ops->send_intr(mdev, db); |
655 | for (i = retry; i--;) { | 655 | for (retry = 100; retry--;) { |
656 | ret = wait_event_timeout(wake, | 656 | ret = wait_event_timeout(wake, |
657 | mvdev->dc->guest_ack, msecs_to_jiffies(100)); | 657 | mvdev->dc->guest_ack, msecs_to_jiffies(100)); |
658 | if (ret) | 658 | if (ret) |
659 | break; | 659 | break; |
660 | } | 660 | } |
661 | dev_dbg(mdev->sdev->parent, | 661 | dev_dbg(mdev->sdev->parent, |
662 | "Device id %d config_change %d guest_ack %d\n", | 662 | "Device id %d config_change %d guest_ack %d retry %d\n", |
663 | mvdev->virtio_id, mvdev->dc->config_change, | 663 | mvdev->virtio_id, mvdev->dc->config_change, |
664 | mvdev->dc->guest_ack); | 664 | mvdev->dc->guest_ack, retry); |
665 | mvdev->dc->config_change = 0; | 665 | mvdev->dc->config_change = 0; |
666 | mvdev->dc->guest_ack = 0; | 666 | mvdev->dc->guest_ack = 0; |
667 | skip_hot_remove: | 667 | skip_hot_remove: |
diff --git a/drivers/misc/mic/host/mic_x100.c b/drivers/misc/mic/host/mic_x100.c index 81e9541b784c..0dfa8a81436e 100644 --- a/drivers/misc/mic/host/mic_x100.c +++ b/drivers/misc/mic/host/mic_x100.c | |||
@@ -397,8 +397,8 @@ mic_x100_load_ramdisk(struct mic_device *mdev) | |||
397 | * so copy over the ramdisk @ 128M. | 397 | * so copy over the ramdisk @ 128M. |
398 | */ | 398 | */ |
399 | memcpy_toio(mdev->aper.va + (mdev->bootaddr << 1), fw->data, fw->size); | 399 | memcpy_toio(mdev->aper.va + (mdev->bootaddr << 1), fw->data, fw->size); |
400 | iowrite32(cpu_to_le32(mdev->bootaddr << 1), &bp->hdr.ramdisk_image); | 400 | iowrite32(mdev->bootaddr << 1, &bp->hdr.ramdisk_image); |
401 | iowrite32(cpu_to_le32(fw->size), &bp->hdr.ramdisk_size); | 401 | iowrite32(fw->size, &bp->hdr.ramdisk_size); |
402 | release_firmware(fw); | 402 | release_firmware(fw); |
403 | error: | 403 | error: |
404 | return rc; | 404 | return rc; |