linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: linux-pci@vger.kernel.org, bhelgaas@google.com
Cc: linux-kernel@vger.kernel.org, rajatxjain@gmail.com, yinghai@kernel.org
Subject: [PATCH] PCI: pciehp: Flush slot control prior to reset
Date: Fri, 07 Nov 2014 15:54:41 -0700	[thread overview]
Message-ID: <20141107225359.1937.61243.stgit@gimli.home> (raw)

Since 3461a068661c we don't automatically do a pcie_wait_cmd() for
as part of pcie_write_cmd(), it needs to be called explicitly or
triggered by the next pcie_write_cmd().  However, when we do a
secondary bus reset and we're using pcie_write_cmd() to make sure
that we don't see that bus reset as a hotplug event, we really want
to make sure the update is complete.  Testing on an old Lenovo S20
system, which sets surprise hotplug for some slots, this failure to
flush results in a link down event seen by the hotplug controller
when we issue the bus reset and returns us to the undesireable
behavior of removing and re-adding the device.  Force a flush by
adding an explicit call to pcie_wait_cmd().

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org [3.17]
---

 drivers/pci/hotplug/pciehp_hpc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 0ebf754..e540966 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -660,6 +660,7 @@ int pciehp_reset_slot(struct slot *slot, int probe)
 		 pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, 0);
 	if (pciehp_poll_mode)
 		del_timer_sync(&ctrl->poll_timer);
+	pcie_wait_cmd(ctrl);
 
 	pci_reset_bridge_secondary_bus(ctrl->pcie->port);
 


             reply	other threads:[~2014-11-07 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 22:54 Alex Williamson [this message]
2014-11-10 20:45 ` [PATCH] PCI: pciehp: Flush slot control prior to reset Alex Williamson

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=20141107225359.1937.61243.stgit@gimli.home \
    --to=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatxjain@gmail.com \
    --cc=yinghai@kernel.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).