[PATCH 3/4] powerpc: EEH: capture and log pci state on error

Olof Johansson olof at lixom.net
Wed May 9 14:54:39 EST 2007


Hi,

On Tue, May 08, 2007 at 06:35:32PM -0500, Linas Vepstas wrote:

> Index: linux-2.6.21-rc7-mm2/arch/powerpc/platforms/pseries/eeh.c
> ===================================================================
> --- linux-2.6.21-rc7-mm2.orig/arch/powerpc/platforms/pseries/eeh.c	2007-04-26 15:37:32.000000000 -0500
> +++ linux-2.6.21-rc7-mm2/arch/powerpc/platforms/pseries/eeh.c	2007-04-26 16:19:28.000000000 -0500
> @@ -100,6 +100,9 @@ static unsigned char slot_errbuf[RTAS_ER
>  static DEFINE_SPINLOCK(slot_errbuf_lock);
>  static int eeh_error_buf_size;
>  
> +#define EEH_PCI_REGS_LOG_LEN 4096
> +static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN];
> +

I'm guessing this has to be in BSS because of the requrements of being
addressable in realmode for RTAS? Could be nice to document in a comment
so noone tries to make it a local variable later on.

> +void eeh_slot_error_detail(struct pci_dn *pdn, int severity)
> +{
> +	size_t loglen = 0;
> +	memset(pci_regs_buf, 0, EEH_PCI_REGS_LOG_LEN);

Should be no need to do a full memset, just set the first character to 0?

> +	rtas_pci_enable(pdn, EEH_THAW_MMIO);
> +	loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN);
> +
> +	rtas_slot_error_detail(pdn, severity, pci_regs_buf, loglen);


-Olof



More information about the Linuxppc-dev mailing list