linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org
Cc: "Mathias Nyman" <mathias.nyman@intel.com>,
	x86@kernel.org, "Felipe Balbi" <balbi@ti.com>,
	"Yu Zhao" <yu.zhao@intel.com>, "Huang Rui" <ray.huang@amd.com>,
	"Krzysztof Hałasa" <khalasa@piap.pl>,
	"Matthew Wilcox" <willy@linux.intel.com>,
	"Jason Chang" <jason.chang@amd.com>
Subject: [PATCH v2 4/5] PCI: Revert aeb30016fec3 ("PCI: add Intel USB specific reset method")
Date: Tue, 14 Jul 2015 14:35:01 -0500	[thread overview]
Message-ID: <20150714193501.13224.74481.stgit@bhelgaas-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <20150714193153.13224.40528.stgit@bhelgaas-glaptop2.roam.corp.google.com>

Revert aeb30016fec3 ("PCI: add Intel USB specific reset method").

We checked for "dev->class == PCI_CLASS_SERIAL_USB", but dev->class
contains the entire three-byte base class/sub-class/interface, while
PCI_CLASS_SERIAL_USB is only the two-byte base class/sub-class.

This error meant that we used the Intel device-specific reset on devices
with class code 0x000c03 instead of those with class code 0x0c03xx.
0x000c03 is a reserved value in the 0x00 backwards compatibility base
class and shouldn't match any devices, so I think reset_intel_generic_dev()
always failed.

I considered adding a shift, but I can't test it, so it's as likely to
break something as to fix something.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Yu Zhao <yu.zhao@intel.com>
CC: Mathias Nyman <mathias.nyman@intel.com>
---
 drivers/pci/quirks.c |   24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 9734b42..35f8d40 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3344,28 +3344,6 @@ fs_initcall_sync(pci_apply_final_quirks);
  * reset a single function if other methods (e.g. FLR, PM D0->D3) are
  * not available.
  */
-static int reset_intel_generic_dev(struct pci_dev *dev, int probe)
-{
-	int pos;
-
-	/* only implement PCI_CLASS_SERIAL_USB at present */
-	if (dev->class == PCI_CLASS_SERIAL_USB) {
-		pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
-		if (!pos)
-			return -ENOTTY;
-
-		if (probe)
-			return 0;
-
-		pci_write_config_byte(dev, pos + 0x4, 1);
-		msleep(100);
-
-		return 0;
-	} else {
-		return -ENOTTY;
-	}
-}
-
 static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe)
 {
 	/*
@@ -3524,8 +3502,6 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
 		reset_ivb_igd },
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_M2_VGA,
 		reset_ivb_igd },
-	{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
-		reset_intel_generic_dev },
 	{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
 		reset_chelsio_generic_dev },
 	{ 0 }


  parent reply	other threads:[~2015-07-14 19:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 19:34 [PATCH v2 0/5] PCI: Fix class code usage Bjorn Helgaas
2015-07-14 19:34 ` [PATCH v2 1/5] PCI: Use PCI_CLASS_SERIAL_USB instead of bare number Bjorn Helgaas
2015-07-14 19:34 ` [PATCH v2 2/5] PCI: Fix generic NCR 53c810 class code quirk Bjorn Helgaas
2015-07-14 19:34 ` [PATCH v2 3/5] PCI: Fix TI816X " Bjorn Helgaas
2015-07-14 19:35 ` Bjorn Helgaas [this message]
2015-07-14 19:35 ` [PATCH v2 5/5] PCI: Shift PCI_CLASS_NOT_DEFINED consistently with other classes Bjorn Helgaas

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=20150714193501.13224.74481.stgit@bhelgaas-glaptop2.roam.corp.google.com \
    --to=bhelgaas@google.com \
    --cc=balbi@ti.com \
    --cc=jason.chang@amd.com \
    --cc=khalasa@piap.pl \
    --cc=linux-pci@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=ray.huang@amd.com \
    --cc=willy@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=yu.zhao@intel.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).