linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Linas Vepstas" <linasvepstas@gmail.com>
To: "Mike Mason" <mmlnx@us.ibm.com>
Cc: paulus@samba.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Restore PERR/SERR bit settings during EEH device recovery
Date: Tue, 8 Jul 2008 08:38:35 -0500	[thread overview]
Message-ID: <3ae3aa420807080638t41e8851bx2ad061dd5a4e0279@mail.gmail.com> (raw)
In-Reply-To: <4872DC9C.4000706@us.ibm.com>

2008/7/7 Mike Mason <mmlnx@us.ibm.com>:
> The following patch restores the PERR and SERR bits in the PCI
> command register during an EEH device recovery.
> We have found at least one case (an Agilent test card) where the
> PERR/SERR bits are set to 1 by firmware at boot time, but are
> not restored to 1 during EEH recovery.

Any chance they should be zero, and were accidentally set to 1?
In which case, you'd need an else clause, below.

> The patch fixes the
> Agilent card problem.  It has been tested on several other EEH-enabled cards
> with no regressions.
>
> Signed-off-by: Mike Mason <mmlnx@us.ibm.com>
>
> --- linux-2.6.26-rc9/arch/powerpc/platforms/pseries/eeh.c       2008-07-07
> 16:06:57.000000000 -0700
> +++ linux-2.6.26-rc9-new/arch/powerpc/platforms/pseries/eeh.c   2008-07-07
> 16:11:10.000000000 -0700
> @@ -812,6 +812,7 @@
> static inline void __restore_bars (struct pci_dn *pdn)
> {
>        int i;
> +       u32 cmd;
>
>        if (NULL==pdn->phb) return;
>        for (i=4; i<10; i++) {
> @@ -832,6 +833,15 @@
>
>        /* max latency, min grant, interrupt pin and line */
>        rtas_write_config(pdn, 15*4, 4, pdn->config_space[15]);
> +
> +       /* Restore PERR & SERR bits, some devices require it,
> +          don't touch the other command bits */
> +       rtas_read_config(pdn, PCI_COMMAND, 4, &cmd);
> +       if (pdn->config_space[1] & PCI_COMMAND_PARITY)
> +               cmd |= PCI_COMMAND_PARITY;

else cmd &= ~PCI_COMMAND_PARITY;

> +       if (pdn->config_space[1] & PCI_COMMAND_SERR)
> +               cmd |= PCI_COMMAND_SERR;

else cmd &= ~PCI_COMMAND_SERR;

> +       rtas_write_config(pdn, PCI_COMMAND, 4, cmd);
> }

Other than that, I'll add an

Acked-by: Linas Vepstas <linasvepstas@gmail.com>

--linas

  reply	other threads:[~2008-07-08 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08  3:18 [PATCH] Restore PERR/SERR bit settings during EEH device recovery Mike Mason
2008-07-08 13:38 ` Linas Vepstas [this message]
2008-07-08 15:56   ` Mike Mason
2008-07-08 16:04   ` Mike Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ae3aa420807080638t41e8851bx2ad061dd5a4e0279@mail.gmail.com \
    --to=linasvepstas@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mmlnx@us.ibm.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).