From: Oliver O'Halloran <oohall@gmail.com>
To: Sam Bobroff <sbobroff@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/4] powerpc/eeh: Remove workaround from eeh_add_device_late()
Date: Fri, 03 Apr 2020 17:08:32 +1100 [thread overview]
Message-ID: <c7e81c27a6da9f7a4266cec9995b597bce4efc7b.camel@gmail.com> (raw)
In-Reply-To: <252491a9c3fb015383ac757220c5df43d168fe4e.1585544197.git.sbobroff@linux.ibm.com>
On Mon, 2020-03-30 at 15:56 +1100, Sam Bobroff wrote:
> When EEH device state was released asynchronously by the device
> release handler, it was possible for an outstanding reference to
> prevent it's release and it was necessary to work around that if a
> device was re-discovered at the same PCI location.
I think this is a bit misleading. The main situation where you'll hit
this hack is when recovering a device with a driver that doesn't
implement the error handling callbacks. In that case the device is
removed, reset, then re-probed by the PCI core, but we assume it's the
same physical device so the eeh_device state remains active.
If you actually changed the underlying device I suspect something bad
would happen.
> Now that the state is released synchronously that is no longer
> possible and the workaround is no longer necessary.
You could probably fold this into the previous patch, but eh. You could
probably fold this into the previous patch, but eh.
> Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
> ---
> arch/powerpc/kernel/eeh.c | 23 +----------------------
> 1 file changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
> index c36c5a7db5ca..12c248a16527 100644
> --- a/arch/powerpc/kernel/eeh.c
> +++ b/arch/powerpc/kernel/eeh.c
> @@ -1206,28 +1206,7 @@ void eeh_add_device_late(struct pci_dev *dev)
> eeh_edev_dbg(edev, "Device already referenced!\n");
> return;
> }
> -
> - /*
> - * The EEH cache might not be removed correctly because of
> - * unbalanced kref to the device during unplug time, which
> - * relies on pcibios_release_device(). So we have to remove
> - * that here explicitly.
> - */
> - if (edev->pdev) {
> - eeh_rmv_from_parent_pe(edev);
> - eeh_addr_cache_rmv_dev(edev->pdev);
> - eeh_sysfs_remove_device(edev->pdev);
> -
> - /*
> - * We definitely should have the PCI device removed
> - * though it wasn't correctly. So we needn't call
> - * into error handler afterwards.
> - */
> - edev->mode |= EEH_DEV_NO_HANDLER;
> -
> - edev->pdev = NULL;
> - dev->dev.archdata.edev = NULL;
> - }
> + WARN_ON_ONCE(edev->pdev);
>
> if (eeh_has_flag(EEH_PROBE_MODE_DEV))
> eeh_ops->probe(pdn, NULL);
next prev parent reply other threads:[~2020-04-03 6:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 4:56 [PATCH 0/4] powerpc/eeh: Release EEH device state synchronously Sam Bobroff
2020-03-30 4:56 ` [PATCH 1/4] powerpc/eeh: fix pseries_eeh_configure_bridge() Sam Bobroff
2020-04-03 4:19 ` Oliver O'Halloran
2020-03-30 4:56 ` [PATCH 2/4] powerpc/eeh: Release EEH device state synchronously Sam Bobroff
2020-04-03 4:51 ` Oliver O'Halloran
2020-04-08 6:15 ` Sam Bobroff
2020-03-30 4:56 ` [PATCH 3/4] powerpc/eeh: Remove workaround from eeh_add_device_late() Sam Bobroff
2020-04-03 6:08 ` Oliver O'Halloran [this message]
2020-04-08 6:21 ` Sam Bobroff
2020-04-08 6:53 ` Oliver O'Halloran
2020-04-15 6:44 ` Sam Bobroff
2020-03-30 4:56 ` [PATCH 4/4] powerpc/eeh: Clean up edev cleanup for VFs Sam Bobroff
2020-04-03 5:45 ` Oliver O'Halloran
2020-04-08 6:33 ` Sam Bobroff
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=c7e81c27a6da9f7a4266cec9995b597bce4efc7b.camel@gmail.com \
--to=oohall@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sbobroff@linux.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).