linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Richard A Lary <rlary@linux.vnet.ibm.com>
Cc: antonb@au1.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/3]  [PATCH 1/3]powerpc/eeh: Propagate needs_freset flag to device at PE
Date: Wed, 04 May 2011 16:07:34 +1000	[thread overview]
Message-ID: <1304489254.2513.356.camel@pasglop> (raw)
In-Reply-To: <4DB1DE33.5030206@linux.vnet.ibm.com>

On Fri, 2011-04-22 at 12:59 -0700, Richard A Lary wrote:
> From: Richard A Lary <rlary@linux.vnet.ibm.com>
> 
>   For multifunction adapters with a PCI bridge or switch as the device
>   at the Partitionable Endpoint(PE), if one or more devices below PE
>   sets dev->needs_freset, that value will be set for the PE device.
> 
>   In other words, if any device below PE requires a fundamental reset
>   the PE will request a fundamental reset.
> 
> Signed-off-by: Richard A Lary <rlary@linux.vnet.ibm.com>
> ---

This patch and the next one didn't apply cleanly for some reason.

I've hand applied both and will push to -next in a few minutes, please
let me know if it's all correct.

The third one, I gave up as I was running out of time, please re-post a
version that applies on top of powerpc-next.

Cheers,
Ben.

>   arch/powerpc/platforms/pseries/eeh.c |   48 	42 +	6 -	0 !
>   1 file changed, 42 insertions(+), 6 deletions(-)
> 
> Index: b/arch/powerpc/platforms/pseries/eeh.c
> ===================================================================
> --- a/arch/powerpc/platforms/pseries/eeh.c
> +++ b/arch/powerpc/platforms/pseries/eeh.c
> @@ -448,6 +448,39 @@ void eeh_clear_slot (struct device_node
>   	raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
>   }
> 
> +void __eeh_set_pe_freset(struct device_node *parent, unsigned int *freset)
> +{
> +	struct device_node *dn;
> +
> +	for_each_child_of_node(parent, dn) {
> +		if (PCI_DN(dn)) {
> +
> +			struct pci_dev *dev = PCI_DN(dn)->pcidev;
> +
> +			if (dev && dev->driver)
> +				*freset |= dev->needs_freset;
> +
> +			__eeh_set_pe_freset(dn, freset);
> +		}
> +	}
> +}
> +
> +void eeh_set_pe_freset(struct device_node *dn, unsigned int *freset)
> +{
> +	struct pci_dev *dev;
> +	dn = find_device_pe(dn);
> +
> +	/* Back up one, since config addrs might be shared */
> +	if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent))
> +		dn = dn->parent;
> +
> +	dev = PCI_DN(dn)->pcidev;
> +	if (dev)
> +		*freset |= dev->needs_freset;
> +
> +	__eeh_set_pe_freset(dn, freset);
> +}
> +
>   /**
>    * eeh_dn_check_failure - check if all 1's data is due to EEH slot freeze
>    * @dn device node
> @@ -736,18 +769,21 @@ int pcibios_set_pcie_reset_state(struct
>   /**
>    * rtas_set_slot_reset -- assert the pci #RST line for 1/4 second
>    * @pdn: pci device node to be reset.
> - *
> - *  Return 0 if success, else a non-zero value.
>    */
> 
>   static void __rtas_set_slot_reset(struct pci_dn *pdn)
>   {
> -	struct pci_dev *dev = pdn->pcidev;
> +	unsigned int freset = 0;
> 
> -	/* Determine type of EEH reset required by device,
> -	 * default hot reset or fundamental reset
> +	/* Determine type of EEH reset required for
> +	 * Partitionable Endpoint, a hot-reset (1)
> +	 * or a fundamental reset (3).
> +	 * A fundamental reset required by any device under
> +	 * Partitionable Endpoint trumps hot-reset.
>   	 */
> -	if (dev && dev->needs_freset)
> +	eeh_set_pe_freset(pdn->node, &freset);
> +
> +	if (freset)
>   		rtas_pci_slot_reset(pdn, 3);
>   	else
>   		rtas_pci_slot_reset(pdn, 1);

      reply	other threads:[~2011-05-04  6:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 19:59 [PATCH 1/3] [PATCH 1/3]powerpc/eeh: Propagate needs_freset flag to device at PE Richard A Lary
2011-05-04  6:07 ` Benjamin Herrenschmidt [this message]

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=1304489254.2513.356.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=antonb@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rlary@linux.vnet.ibm.com \
    /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).