Commit 29f8bf1b authored by Gavin Shan's avatar Gavin Shan Committed by Benjamin Herrenschmidt

powerpc/pseries: Cleanup comments in EEH aux components

There're several EEH aux components and the patch does some cleanup
for them so that they look more clean.

        * Duplicated comments have been removed from the header file.
        * Comments have been reorganized so that it looks more clean.
        * The leading comments of functions are adjusted for a little
          bit so that the result of "make pdfdocs" would be more
          unified.
        * Function calls "xxx ()" has been replaced by "xxx()".
Signed-off-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1823fbf1
/* /*
* eeh_event.h
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -22,32 +20,20 @@ ...@@ -22,32 +20,20 @@
#define ASM_POWERPC_EEH_EVENT_H #define ASM_POWERPC_EEH_EVENT_H
#ifdef __KERNEL__ #ifdef __KERNEL__
/** EEH event -- structure holding pci controller data that describes /*
* a change in the isolation status of a PCI slot. A pointer * structure holding pci controller data that describes a
* to this struct is passed as the data pointer in a notify callback. * change in the isolation status of a PCI slot. A pointer
* to this struct is passed as the data pointer in a notify
* callback.
*/ */
struct eeh_event { struct eeh_event {
struct list_head list; struct list_head list; /* to form event queue */
struct device_node *dn; /* struct device node */ struct device_node *dn; /* struct device node */
struct pci_dev *dev; /* affected device */ struct pci_dev *dev; /* affected device */
}; };
/** int eeh_send_failure_event(struct device_node *dn, struct pci_dev *dev);
* eeh_send_failure_event - generate a PCI error event struct pci_dn *handle_eeh_events(struct eeh_event *);
* @dev pci device
*
* This routine builds a PCI error event which will be delivered
* to all listeners on the eeh_notifier_chain.
*
* This routine can be called within an interrupt context;
* the actual event will be delivered in a normal context
* (from a workqueue).
*/
int eeh_send_failure_event (struct device_node *dn,
struct pci_dev *dev);
/* Main recovery function */
struct pci_dn * handle_eeh_events (struct eeh_event *);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* ASM_POWERPC_EEH_EVENT_H */ #endif /* ASM_POWERPC_EEH_EVENT_H */
/* /*
* eeh_cache.c
* PCI address cache; allows the lookup of PCI devices based on I/O address * PCI address cache; allows the lookup of PCI devices based on I/O address
* *
* Copyright IBM Corporation 2004 * Copyright IBM Corporation 2004
...@@ -47,8 +46,7 @@ ...@@ -47,8 +46,7 @@
* than any hash algo I could think of for this problem, even * than any hash algo I could think of for this problem, even
* with the penalty of slow pointer chases for d-cache misses). * with the penalty of slow pointer chases for d-cache misses).
*/ */
struct pci_io_addr_range struct pci_io_addr_range {
{
struct rb_node rb_node; struct rb_node rb_node;
unsigned long addr_lo; unsigned long addr_lo;
unsigned long addr_hi; unsigned long addr_hi;
...@@ -56,8 +54,7 @@ struct pci_io_addr_range ...@@ -56,8 +54,7 @@ struct pci_io_addr_range
unsigned int flags; unsigned int flags;
}; };
static struct pci_io_addr_cache static struct pci_io_addr_cache {
{
struct rb_root rb_root; struct rb_root rb_root;
spinlock_t piar_lock; spinlock_t piar_lock;
} pci_io_addr_cache_root; } pci_io_addr_cache_root;
...@@ -166,7 +163,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo, ...@@ -166,7 +163,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
#ifdef DEBUG #ifdef DEBUG
printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n", printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n",
alo, ahi, pci_name (dev)); alo, ahi, pci_name(dev));
#endif #endif
rb_link_node(&piar->rb_node, parent, p); rb_link_node(&piar->rb_node, parent, p);
......
This diff is collapsed.
/* /*
* eeh_event.c
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -46,7 +44,7 @@ DECLARE_WORK(eeh_event_wq, eeh_thread_launcher); ...@@ -46,7 +44,7 @@ DECLARE_WORK(eeh_event_wq, eeh_thread_launcher);
DEFINE_MUTEX(eeh_event_mutex); DEFINE_MUTEX(eeh_event_mutex);
/** /**
* eeh_event_handler - dispatch EEH events. * eeh_event_handler - Dispatch EEH events.
* @dummy - unused * @dummy - unused
* *
* The detection of a frozen slot can occur inside an interrupt, * The detection of a frozen slot can occur inside an interrupt,
...@@ -61,7 +59,7 @@ static int eeh_event_handler(void * dummy) ...@@ -61,7 +59,7 @@ static int eeh_event_handler(void * dummy)
struct eeh_event *event; struct eeh_event *event;
struct pci_dn *pdn; struct pci_dn *pdn;
daemonize ("eehd"); daemonize("eehd");
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
spin_lock_irqsave(&eeh_eventlist_lock, flags); spin_lock_irqsave(&eeh_eventlist_lock, flags);
...@@ -93,7 +91,7 @@ static int eeh_event_handler(void * dummy) ...@@ -93,7 +91,7 @@ static int eeh_event_handler(void * dummy)
/* If there are no new errors after an hour, clear the counter. */ /* If there are no new errors after an hour, clear the counter. */
if (pdn && pdn->eeh_freeze_count>0) { if (pdn && pdn->eeh_freeze_count>0) {
msleep_interruptible (3600*1000); msleep_interruptible(3600*1000);
if (pdn->eeh_freeze_count>0) if (pdn->eeh_freeze_count>0)
pdn->eeh_freeze_count--; pdn->eeh_freeze_count--;
} }
...@@ -102,8 +100,11 @@ static int eeh_event_handler(void * dummy) ...@@ -102,8 +100,11 @@ static int eeh_event_handler(void * dummy)
} }
/** /**
* eeh_thread_launcher * eeh_thread_launcher - Start kernel thread to handle EEH events
* @dummy - unused * @dummy - unused
*
* This routine is called to start the kernel thread for processing
* EEH event.
*/ */
static void eeh_thread_launcher(struct work_struct *dummy) static void eeh_thread_launcher(struct work_struct *dummy)
{ {
...@@ -112,14 +113,14 @@ static void eeh_thread_launcher(struct work_struct *dummy) ...@@ -112,14 +113,14 @@ static void eeh_thread_launcher(struct work_struct *dummy)
} }
/** /**
* eeh_send_failure_event - generate a PCI error event * eeh_send_failure_event - Generate a PCI error event
* @dev pci device * @dev: pci device
* *
* This routine can be called within an interrupt context; * This routine can be called within an interrupt context;
* the actual event will be delivered in a normal context * the actual event will be delivered in a normal context
* (from a workqueue). * (from a workqueue).
*/ */
int eeh_send_failure_event (struct device_node *dn, int eeh_send_failure_event(struct device_node *dn,
struct pci_dev *dev) struct pci_dev *dev)
{ {
unsigned long flags; unsigned long flags;
...@@ -135,7 +136,7 @@ int eeh_send_failure_event (struct device_node *dn, ...@@ -135,7 +136,7 @@ int eeh_send_failure_event (struct device_node *dn,
} }
event = kmalloc(sizeof(*event), GFP_ATOMIC); event = kmalloc(sizeof(*event), GFP_ATOMIC);
if (event == NULL) { if (event == NULL) {
printk (KERN_ERR "EEH: out of memory, event not handled\n"); printk(KERN_ERR "EEH: out of memory, event not handled\n");
return 1; return 1;
} }
...@@ -154,5 +155,3 @@ int eeh_send_failure_event (struct device_node *dn, ...@@ -154,5 +155,3 @@ int eeh_send_failure_event (struct device_node *dn,
return 0; return 0;
} }
/********************** END OF FILE ******************************/
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
/** /**
* EEH_SHOW_ATTR -- create sysfs entry for eeh statistic * EEH_SHOW_ATTR -- Create sysfs entry for eeh statistic
* @_name: name of file in sysfs directory * @_name: name of file in sysfs directory
* @_memb: name of member in struct pci_dn to access * @_memb: name of member in struct pci_dn to access
* @_format: printf format for display * @_format: printf format for display
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment