arch/powerpc/kernel/eeh_sysfs.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/eeh_sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/eeh_sysfs.c- Extension
.c- Size
- 5169 bytes
- Lines
- 183
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/of.hlinux/pci.hlinux/stat.hlinux/sysfs.hasm/ppc-pci.hasm/pci-bridge.h
Detected Declarations
function eeh_pe_state_showfunction eeh_pe_state_storefunction eeh_notify_resume_showfunction eeh_notify_resume_storefunction eeh_notify_resume_addfunction eeh_notify_resume_removefunction eeh_notify_resume_addfunction eeh_notify_resume_removefunction eeh_sysfs_remove_device
Annotated Snippet
static inline int eeh_notify_resume_add(struct pci_dev *pdev) { return 0; }
static inline void eeh_notify_resume_remove(struct pci_dev *pdev) { }
#endif /* CONFIG_PCI_IOV && CONFIG PPC_PSERIES*/
void eeh_sysfs_add_device(struct pci_dev *pdev)
{
struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev);
int rc=0;
if (!eeh_enabled())
return;
if (edev && (edev->mode & EEH_DEV_SYSFS))
return;
rc += device_create_file(&pdev->dev, &dev_attr_eeh_mode);
rc += device_create_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
rc += device_create_file(&pdev->dev, &dev_attr_eeh_pe_state);
rc += eeh_notify_resume_add(pdev);
if (rc)
pr_warn("EEH: Unable to create sysfs entries\n");
else if (edev)
edev->mode |= EEH_DEV_SYSFS;
}
void eeh_sysfs_remove_device(struct pci_dev *pdev)
{
struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev);
if (!edev) {
WARN_ON(eeh_enabled());
return;
}
edev->mode &= ~EEH_DEV_SYSFS;
/*
* The parent directory might have been removed. We needn't
* continue for that case.
*/
if (!pdev->dev.kobj.sd)
return;
device_remove_file(&pdev->dev, &dev_attr_eeh_mode);
device_remove_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
device_remove_file(&pdev->dev, &dev_attr_eeh_pe_state);
eeh_notify_resume_remove(pdev);
}
Annotation
- Immediate include surface: `linux/of.h`, `linux/pci.h`, `linux/stat.h`, `linux/sysfs.h`, `asm/ppc-pci.h`, `asm/pci-bridge.h`.
- Detected declarations: `function eeh_pe_state_show`, `function eeh_pe_state_store`, `function eeh_notify_resume_show`, `function eeh_notify_resume_store`, `function eeh_notify_resume_add`, `function eeh_notify_resume_remove`, `function eeh_notify_resume_add`, `function eeh_notify_resume_remove`, `function eeh_sysfs_remove_device`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.