drivers/misc/genwqe/card_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/misc/genwqe/card_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/genwqe/card_debugfs.c- Extension
.c- Size
- 10485 bytes
- Lines
- 379
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/debugfs.hlinux/seq_file.hlinux/uaccess.hcard_base.hcard_ddcb.h
Detected Declarations
function dbg_uidn_showfunction curr_dbg_uidn_showfunction curr_dbg_uid0_showfunction curr_dbg_uid1_showfunction curr_dbg_uid2_showfunction prev_dbg_uidn_showfunction prev_dbg_uid0_showfunction prev_dbg_uid1_showfunction prev_dbg_uid2_showfunction curr_regs_showfunction prev_regs_showfunction jtimer_showfunction queue_working_time_showfunction ddcb_info_showfunction info_showfunction genwqe_init_debugfsfunction genqwe_exit_debugfs
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* IBM Accelerator Family 'GenWQE'
*
* (C) Copyright IBM Corp. 2013
*
* Author: Frank Haverkamp <haver@linux.vnet.ibm.com>
* Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
* Author: Michael Jung <mijung@gmx.net>
* Author: Michael Ruettger <michael@ibmra.de>
*/
/*
* Debugfs interfaces for the GenWQE card. Help to debug potential
* problems. Dump internal chip state for debugging and failure
* determination.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include "card_base.h"
#include "card_ddcb.h"
static void dbg_uidn_show(struct seq_file *s, struct genwqe_reg *regs,
int entries)
{
unsigned int i;
u32 v_hi, v_lo;
for (i = 0; i < entries; i++) {
v_hi = (regs[i].val >> 32) & 0xffffffff;
v_lo = (regs[i].val) & 0xffffffff;
seq_printf(s, " 0x%08x 0x%08x 0x%08x 0x%08x EXT_ERR_REC\n",
regs[i].addr, regs[i].idx, v_hi, v_lo);
}
}
static int curr_dbg_uidn_show(struct seq_file *s, void *unused, int uid)
{
struct genwqe_dev *cd = s->private;
int entries;
struct genwqe_reg *regs;
entries = genwqe_ffdc_buff_size(cd, uid);
if (entries < 0)
return -EINVAL;
if (entries == 0)
return 0;
regs = kzalloc_objs(*regs, entries);
if (regs == NULL)
return -ENOMEM;
genwqe_stop_traps(cd); /* halt the traps while dumping data */
genwqe_ffdc_buff_read(cd, uid, regs, entries);
genwqe_start_traps(cd);
dbg_uidn_show(s, regs, entries);
kfree(regs);
return 0;
}
static int curr_dbg_uid0_show(struct seq_file *s, void *unused)
{
return curr_dbg_uidn_show(s, unused, 0);
}
DEFINE_SHOW_ATTRIBUTE(curr_dbg_uid0);
static int curr_dbg_uid1_show(struct seq_file *s, void *unused)
{
return curr_dbg_uidn_show(s, unused, 1);
}
DEFINE_SHOW_ATTRIBUTE(curr_dbg_uid1);
static int curr_dbg_uid2_show(struct seq_file *s, void *unused)
{
return curr_dbg_uidn_show(s, unused, 2);
}
DEFINE_SHOW_ATTRIBUTE(curr_dbg_uid2);
static int prev_dbg_uidn_show(struct seq_file *s, void *unused, int uid)
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/debugfs.h`, `linux/seq_file.h`, `linux/uaccess.h`, `card_base.h`, `card_ddcb.h`.
- Detected declarations: `function dbg_uidn_show`, `function curr_dbg_uidn_show`, `function curr_dbg_uid0_show`, `function curr_dbg_uid1_show`, `function curr_dbg_uid2_show`, `function prev_dbg_uidn_show`, `function prev_dbg_uid0_show`, `function prev_dbg_uid1_show`, `function prev_dbg_uid2_show`, `function curr_regs_show`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.