linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Wei Yang <weiyang@linux.vnet.ibm.com>,
	gwshan@linux.vnet.ibm.com, bhelgaas@google.com, aik@ozlabs.ru
Cc: linux-pci@vger.kernel.org, Wei Yang <weiyang@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [V13,9/9] powerpc/eeh: Support error recovery for VF PE
Date: Thu, 19 Nov 2015 22:46:39 +1100 (AEDT)	[thread overview]
Message-ID: <20151119114639.40721141498@ozlabs.org> (raw)
In-Reply-To: <1446939035-2617-10-git-send-email-weiyang@linux.vnet.ibm.com>

On Sat, 2015-07-11 at 23:30:35 UTC, Wei Yang wrote:
> PFs are enumerated on PCI bus, while VFs are created by PF's driver.
> 
> In EEH recovery, it has two cases:
> 1. Device and driver is EEH aware, error handlers are called.
> 2. Device and driver is not EEH aware, un-plug the device and plug it again
> by enumerating it.
> 
> The special thing happens on the second case. For a PF, we could use the
> original pci core to enumerate the bus, while for VF we need to record the
> VFs which aer un-plugged then plug it again.
> 
> Also The patch caches the VF index in pci_dn, which can be used to
> calculate VF's bus, device and function number. Those information helps to
> locate the VF's PCI device instance when doing hotplug during EEH recovery
> if necessary.

> diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
> index 9b365d6..533e6e9 100644
> --- a/arch/powerpc/include/asm/pci-bridge.h
> +++ b/arch/powerpc/include/asm/pci-bridge.h
> @@ -211,6 +211,7 @@ struct pci_dn {
>  #define IODA_INVALID_PE		(-1)
>  #ifdef CONFIG_PPC_POWERNV
>  	int	pe_number;
> +	int     vf_index;		/* VF index in the PF */


> diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
> index 89eb4bc..f25428a 100644
> --- a/arch/powerpc/kernel/eeh_driver.c
> +++ b/arch/powerpc/kernel/eeh_driver.c
> @@ -386,12 +396,39 @@ static void *eeh_report_failure(void *data, void *userdata)
>  	return NULL;
>  }
>  
> +static void *eeh_add_virt_device(void *data, void *userdata)
> +{
> +	struct pci_driver *driver;
> +	struct eeh_dev *edev = (struct eeh_dev *)data;
> +	struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
> +	struct pci_dn *pdn = eeh_dev_to_pdn(edev);
> +
> +	if (!(edev->physfn)) {
> +		pr_warn("%s: EEH dev %04x:%02x:%02x.%01x not for VF\n",
> +			__func__, edev->phb->global_number, pdn->busno,
> +			PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
> +		return NULL;
> +	}
> +
> +	driver = eeh_pcid_get(dev);
> +	if (driver) {
> +		eeh_pcid_put(dev);
> +		if (driver->err_handler)
> +			return NULL;
> +	}
> +
> +	pci_iov_virtfn_add(edev->physfn, pdn->vf_index, 0);
                                              ^

This is giving me:

  arch/powerpc/kernel/eeh_driver.c:420:38: error: 'struct pci_dn' has no member named 'vf_index'

And similarly:

  arch/powerpc/kernel/eeh_driver.c:472:42: error: 'struct pci_dn' has no member named 'vf_index'
  arch/powerpc/kernel/eeh_driver.c:479:6: error: 'struct pci_dn' has no member named 'pe_number'


For pseries_defconfig with POWERNV=n.

The reason is that those fields are #ifdef POWERNV, but eeh_driver.c is still
built for PSERIES.

More here:

  http://kisskb.ellerman.id.au/kisskb/buildresult/12550871/


cheers

  reply	other threads:[~2015-11-19 11:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 23:30 [PATCH V13 0/9] VF EEH on Power8 Wei Yang
2015-11-07 23:30 ` [PATCH V13 1/9] PCI/IOV: Rename and export virtfn_add/virtfn_remove Wei Yang
2015-11-07 23:30 ` [PATCH V13 2/9] PCI: Add pcibios_bus_add_device() weak function Wei Yang
2015-11-07 23:30 ` [PATCH V13 3/9] powerpc/pci: Remove VFs prior to PF Wei Yang
2015-11-07 23:30 ` [PATCH V13 4/9] powerpc/eeh: Cache only BARs, not windows or IOV BARs Wei Yang
2015-11-07 23:30 ` [PATCH V13 5/9] powerpc/powernv: EEH device for VF Wei Yang
2015-11-07 23:30 ` [PATCH V13 6/9] powerpc/eeh: Create PE for VFs Wei Yang
2015-11-07 23:30 ` [PATCH V13 7/9] powerpc/powernv: Support EEH reset for VF PE Wei Yang
2015-11-07 23:30 ` [PATCH V13 8/9] powerpc/powernv: Support PCI config restore for VFs Wei Yang
2015-11-07 23:30 ` [PATCH V13 9/9] powerpc/eeh: Support error recovery for VF PE Wei Yang
2015-11-19 11:46   ` Michael Ellerman [this message]
2015-11-08 23:53 ` [PATCH V13 0/9] VF EEH on Power8 Alexey Kardashevskiy
2015-11-09  1:53   ` Wei Yang

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=20151119114639.40721141498@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=aik@ozlabs.ru \
    --cc=bhelgaas@google.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=weiyang@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).