diff options
Diffstat (limited to 'drivers/misc/mic/host/mic_debugfs.c')
-rw-r--r-- | drivers/misc/mic/host/mic_debugfs.c | 90 |
1 files changed, 43 insertions, 47 deletions
diff --git a/drivers/misc/mic/host/mic_debugfs.c b/drivers/misc/mic/host/mic_debugfs.c index 98a61b4319f4..028ba5d6fd1c 100644 --- a/drivers/misc/mic/host/mic_debugfs.c +++ b/drivers/misc/mic/host/mic_debugfs.c | |||
@@ -103,7 +103,7 @@ static int mic_smpt_show(struct seq_file *s, void *pos) | |||
103 | unsigned long flags; | 103 | unsigned long flags; |
104 | 104 | ||
105 | seq_printf(s, "MIC %-2d |%-10s| %-14s %-10s\n", | 105 | seq_printf(s, "MIC %-2d |%-10s| %-14s %-10s\n", |
106 | mdev->id, "SMPT entry", "SW DMA addr", "RefCount"); | 106 | mdev->id, "SMPT entry", "SW DMA addr", "RefCount"); |
107 | seq_puts(s, "====================================================\n"); | 107 | seq_puts(s, "====================================================\n"); |
108 | 108 | ||
109 | if (mdev->smpt) { | 109 | if (mdev->smpt) { |
@@ -111,8 +111,8 @@ static int mic_smpt_show(struct seq_file *s, void *pos) | |||
111 | spin_lock_irqsave(&smpt_info->smpt_lock, flags); | 111 | spin_lock_irqsave(&smpt_info->smpt_lock, flags); |
112 | for (i = 0; i < smpt_info->info.num_reg; i++) { | 112 | for (i = 0; i < smpt_info->info.num_reg; i++) { |
113 | seq_printf(s, "%9s|%-10d| %-#14llx %-10lld\n", | 113 | seq_printf(s, "%9s|%-10d| %-#14llx %-10lld\n", |
114 | " ", i, smpt_info->entry[i].dma_addr, | 114 | " ", i, smpt_info->entry[i].dma_addr, |
115 | smpt_info->entry[i].ref_count); | 115 | smpt_info->entry[i].ref_count); |
116 | } | 116 | } |
117 | spin_unlock_irqrestore(&smpt_info->smpt_lock, flags); | 117 | spin_unlock_irqrestore(&smpt_info->smpt_lock, flags); |
118 | } | 118 | } |
@@ -203,17 +203,17 @@ static int mic_dp_show(struct seq_file *s, void *pos) | |||
203 | int i, j; | 203 | int i, j; |
204 | 204 | ||
205 | seq_printf(s, "Bootparam: magic 0x%x\n", | 205 | seq_printf(s, "Bootparam: magic 0x%x\n", |
206 | bootparam->magic); | 206 | bootparam->magic); |
207 | seq_printf(s, "Bootparam: h2c_shutdown_db %d\n", | 207 | seq_printf(s, "Bootparam: h2c_shutdown_db %d\n", |
208 | bootparam->h2c_shutdown_db); | 208 | bootparam->h2c_shutdown_db); |
209 | seq_printf(s, "Bootparam: h2c_config_db %d\n", | 209 | seq_printf(s, "Bootparam: h2c_config_db %d\n", |
210 | bootparam->h2c_config_db); | 210 | bootparam->h2c_config_db); |
211 | seq_printf(s, "Bootparam: c2h_shutdown_db %d\n", | 211 | seq_printf(s, "Bootparam: c2h_shutdown_db %d\n", |
212 | bootparam->c2h_shutdown_db); | 212 | bootparam->c2h_shutdown_db); |
213 | seq_printf(s, "Bootparam: shutdown_status %d\n", | 213 | seq_printf(s, "Bootparam: shutdown_status %d\n", |
214 | bootparam->shutdown_status); | 214 | bootparam->shutdown_status); |
215 | seq_printf(s, "Bootparam: shutdown_card %d\n", | 215 | seq_printf(s, "Bootparam: shutdown_card %d\n", |
216 | bootparam->shutdown_card); | 216 | bootparam->shutdown_card); |
217 | 217 | ||
218 | for (i = sizeof(*bootparam); i < MIC_DP_SIZE; | 218 | for (i = sizeof(*bootparam); i < MIC_DP_SIZE; |
219 | i += mic_total_desc_size(d)) { | 219 | i += mic_total_desc_size(d)) { |
@@ -239,10 +239,10 @@ static int mic_dp_show(struct seq_file *s, void *pos) | |||
239 | seq_printf(s, "address 0x%llx ", vqconfig->address); | 239 | seq_printf(s, "address 0x%llx ", vqconfig->address); |
240 | seq_printf(s, "num %d ", vqconfig->num); | 240 | seq_printf(s, "num %d ", vqconfig->num); |
241 | seq_printf(s, "used address 0x%llx\n", | 241 | seq_printf(s, "used address 0x%llx\n", |
242 | vqconfig->used_address); | 242 | vqconfig->used_address); |
243 | } | 243 | } |
244 | 244 | ||
245 | features = (__u32 *) mic_vq_features(d); | 245 | features = (__u32 *)mic_vq_features(d); |
246 | seq_printf(s, "Features: Host 0x%x ", features[0]); | 246 | seq_printf(s, "Features: Host 0x%x ", features[0]); |
247 | seq_printf(s, "Guest 0x%x\n", features[1]); | 247 | seq_printf(s, "Guest 0x%x\n", features[1]); |
248 | 248 | ||
@@ -256,7 +256,7 @@ static int mic_dp_show(struct seq_file *s, void *pos) | |||
256 | seq_printf(s, "Guest Ack %d ", dc->guest_ack); | 256 | seq_printf(s, "Guest Ack %d ", dc->guest_ack); |
257 | seq_printf(s, "Host ack %d\n", dc->host_ack); | 257 | seq_printf(s, "Host ack %d\n", dc->host_ack); |
258 | seq_printf(s, "Used address updated %d ", | 258 | seq_printf(s, "Used address updated %d ", |
259 | dc->used_address_updated); | 259 | dc->used_address_updated); |
260 | seq_printf(s, "Vdev 0x%llx\n", dc->vdev); | 260 | seq_printf(s, "Vdev 0x%llx\n", dc->vdev); |
261 | seq_printf(s, "c2h doorbell %d ", dc->c2h_vdev_db); | 261 | seq_printf(s, "c2h doorbell %d ", dc->c2h_vdev_db); |
262 | seq_printf(s, "h2c doorbell %d\n", dc->h2c_vdev_db); | 262 | seq_printf(s, "h2c doorbell %d\n", dc->h2c_vdev_db); |
@@ -294,10 +294,10 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused) | |||
294 | list_for_each_safe(pos, tmp, &mdev->vdev_list) { | 294 | list_for_each_safe(pos, tmp, &mdev->vdev_list) { |
295 | mvdev = list_entry(pos, struct mic_vdev, list); | 295 | mvdev = list_entry(pos, struct mic_vdev, list); |
296 | seq_printf(s, "VDEV type %d state %s in %ld out %ld\n", | 296 | seq_printf(s, "VDEV type %d state %s in %ld out %ld\n", |
297 | mvdev->virtio_id, | 297 | mvdev->virtio_id, |
298 | mic_vdevup(mvdev) ? "UP" : "DOWN", | 298 | mic_vdevup(mvdev) ? "UP" : "DOWN", |
299 | mvdev->in_bytes, | 299 | mvdev->in_bytes, |
300 | mvdev->out_bytes); | 300 | mvdev->out_bytes); |
301 | for (i = 0; i < MIC_MAX_VRINGS; i++) { | 301 | for (i = 0; i < MIC_MAX_VRINGS; i++) { |
302 | struct vring_desc *desc; | 302 | struct vring_desc *desc; |
303 | struct vring_avail *avail; | 303 | struct vring_avail *avail; |
@@ -309,38 +309,38 @@ static int mic_vdev_info_show(struct seq_file *s, void *unused) | |||
309 | continue; | 309 | continue; |
310 | desc = vrh->vring.desc; | 310 | desc = vrh->vring.desc; |
311 | seq_printf(s, "vring i %d avail_idx %d", | 311 | seq_printf(s, "vring i %d avail_idx %d", |
312 | i, mvr->vring.info->avail_idx & (num - 1)); | 312 | i, mvr->vring.info->avail_idx & (num - 1)); |
313 | seq_printf(s, " vring i %d avail_idx %d\n", | 313 | seq_printf(s, " vring i %d avail_idx %d\n", |
314 | i, mvr->vring.info->avail_idx); | 314 | i, mvr->vring.info->avail_idx); |
315 | seq_printf(s, "vrh i %d weak_barriers %d", | 315 | seq_printf(s, "vrh i %d weak_barriers %d", |
316 | i, vrh->weak_barriers); | 316 | i, vrh->weak_barriers); |
317 | seq_printf(s, " last_avail_idx %d last_used_idx %d", | 317 | seq_printf(s, " last_avail_idx %d last_used_idx %d", |
318 | vrh->last_avail_idx, vrh->last_used_idx); | 318 | vrh->last_avail_idx, vrh->last_used_idx); |
319 | seq_printf(s, " completed %d\n", vrh->completed); | 319 | seq_printf(s, " completed %d\n", vrh->completed); |
320 | for (j = 0; j < num; j++) { | 320 | for (j = 0; j < num; j++) { |
321 | seq_printf(s, "desc[%d] addr 0x%llx len %d", | 321 | seq_printf(s, "desc[%d] addr 0x%llx len %d", |
322 | j, desc->addr, desc->len); | 322 | j, desc->addr, desc->len); |
323 | seq_printf(s, " flags 0x%x next %d\n", | 323 | seq_printf(s, " flags 0x%x next %d\n", |
324 | desc->flags, | 324 | desc->flags, desc->next); |
325 | desc->next); | ||
326 | desc++; | 325 | desc++; |
327 | } | 326 | } |
328 | avail = vrh->vring.avail; | 327 | avail = vrh->vring.avail; |
329 | seq_printf(s, "avail flags 0x%x idx %d\n", | 328 | seq_printf(s, "avail flags 0x%x idx %d\n", |
330 | avail->flags, avail->idx & (num - 1)); | 329 | avail->flags, avail->idx & (num - 1)); |
331 | seq_printf(s, "avail flags 0x%x idx %d\n", | 330 | seq_printf(s, "avail flags 0x%x idx %d\n", |
332 | avail->flags, avail->idx); | 331 | avail->flags, avail->idx); |
333 | for (j = 0; j < num; j++) | 332 | for (j = 0; j < num; j++) |
334 | seq_printf(s, "avail ring[%d] %d\n", | 333 | seq_printf(s, "avail ring[%d] %d\n", |
335 | j, avail->ring[j]); | 334 | j, avail->ring[j]); |
336 | used = vrh->vring.used; | 335 | used = vrh->vring.used; |
337 | seq_printf(s, "used flags 0x%x idx %d\n", | 336 | seq_printf(s, "used flags 0x%x idx %d\n", |
338 | used->flags, used->idx & (num - 1)); | 337 | used->flags, used->idx & (num - 1)); |
339 | seq_printf(s, "used flags 0x%x idx %d\n", | 338 | seq_printf(s, "used flags 0x%x idx %d\n", |
340 | used->flags, used->idx); | 339 | used->flags, used->idx); |
341 | for (j = 0; j < num; j++) | 340 | for (j = 0; j < num; j++) |
342 | seq_printf(s, "used ring[%d] id %d len %d\n", | 341 | seq_printf(s, "used ring[%d] id %d len %d\n", |
343 | j, used->ring[j].id, used->ring[j].len); | 342 | j, used->ring[j].id, |
343 | used->ring[j].len); | ||
344 | } | 344 | } |
345 | } | 345 | } |
346 | mutex_unlock(&mdev->mic_mutex); | 346 | mutex_unlock(&mdev->mic_mutex); |
@@ -389,7 +389,7 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos) | |||
389 | reg = mdev->intr_ops->read_msi_to_src_map(mdev, entry); | 389 | reg = mdev->intr_ops->read_msi_to_src_map(mdev, entry); |
390 | 390 | ||
391 | seq_printf(s, "%s %-10d %s %-10d MXAR[%d]: %08X\n", | 391 | seq_printf(s, "%s %-10d %s %-10d MXAR[%d]: %08X\n", |
392 | "IRQ:", vector, "Entry:", entry, i, reg); | 392 | "IRQ:", vector, "Entry:", entry, i, reg); |
393 | 393 | ||
394 | seq_printf(s, "%-10s", "offset:"); | 394 | seq_printf(s, "%-10s", "offset:"); |
395 | for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--) | 395 | for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--) |
@@ -400,8 +400,8 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos) | |||
400 | seq_printf(s, "%-10s", "count:"); | 400 | seq_printf(s, "%-10s", "count:"); |
401 | for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--) | 401 | for (j = (MIC_NUM_OFFSETS - 1); j >= 0; j--) |
402 | seq_printf(s, "%4d ", | 402 | seq_printf(s, "%4d ", |
403 | (mdev->irq_info.mic_msi_map[i] & BIT(j)) ? | 403 | (mdev->irq_info.mic_msi_map[i] & |
404 | 1 : 0); | 404 | BIT(j)) ? 1 : 0); |
405 | seq_puts(s, "\n\n"); | 405 | seq_puts(s, "\n\n"); |
406 | } | 406 | } |
407 | } else { | 407 | } else { |
@@ -409,7 +409,6 @@ static int mic_msi_irq_info_show(struct seq_file *s, void *pos) | |||
409 | } | 409 | } |
410 | 410 | ||
411 | return 0; | 411 | return 0; |
412 | |||
413 | } | 412 | } |
414 | 413 | ||
415 | static int mic_msi_irq_info_debug_open(struct inode *inode, struct file *file) | 414 | static int mic_msi_irq_info_debug_open(struct inode *inode, struct file *file) |
@@ -443,26 +442,23 @@ void mic_create_debug_dir(struct mic_device *mdev) | |||
443 | if (!mdev->dbg_dir) | 442 | if (!mdev->dbg_dir) |
444 | return; | 443 | return; |
445 | 444 | ||
446 | debugfs_create_file("log_buf", 0444, mdev->dbg_dir, | 445 | debugfs_create_file("log_buf", 0444, mdev->dbg_dir, mdev, &log_buf_ops); |
447 | mdev, &log_buf_ops); | ||
448 | 446 | ||
449 | debugfs_create_file("smpt", 0444, mdev->dbg_dir, | 447 | debugfs_create_file("smpt", 0444, mdev->dbg_dir, mdev, &smpt_file_ops); |
450 | mdev, &smpt_file_ops); | ||
451 | 448 | ||
452 | debugfs_create_file("soft_reset", 0444, mdev->dbg_dir, | 449 | debugfs_create_file("soft_reset", 0444, mdev->dbg_dir, mdev, |
453 | mdev, &soft_reset_ops); | 450 | &soft_reset_ops); |
454 | 451 | ||
455 | debugfs_create_file("post_code", 0444, mdev->dbg_dir, | 452 | debugfs_create_file("post_code", 0444, mdev->dbg_dir, mdev, |
456 | mdev, &post_code_ops); | 453 | &post_code_ops); |
457 | 454 | ||
458 | debugfs_create_file("dp", 0444, mdev->dbg_dir, | 455 | debugfs_create_file("dp", 0444, mdev->dbg_dir, mdev, &dp_ops); |
459 | mdev, &dp_ops); | ||
460 | 456 | ||
461 | debugfs_create_file("vdev_info", 0444, mdev->dbg_dir, | 457 | debugfs_create_file("vdev_info", 0444, mdev->dbg_dir, mdev, |
462 | mdev, &vdev_info_ops); | 458 | &vdev_info_ops); |
463 | 459 | ||
464 | debugfs_create_file("msi_irq_info", 0444, mdev->dbg_dir, | 460 | debugfs_create_file("msi_irq_info", 0444, mdev->dbg_dir, mdev, |
465 | mdev, &msi_irq_info_ops); | 461 | &msi_irq_info_ops); |
466 | } | 462 | } |
467 | 463 | ||
468 | /** | 464 | /** |