mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Li, Zhen-Hua" <zhen-hual@hp.com>
To: <stern@rowland.harvard.edu>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: "Li, Zhen-Hua" <zhen-hual@hp.com>
Subject: [PATCH 1/1] usb,uhci: add a new tag for virtual uhci devices
Date: Wed, 26 Jun 2013 14:29:45 +0800	[thread overview]
Message-ID: <1372228185-11518-1-git-send-email-zhen-hual@hp.com> (raw)

From: "Li, Zhen-Hua" <zhen-hual@hp.com>

There's another patch trying to fix this warning:
 "Controller not stopped yet!". 
It is : 997ff893603c6455da4c5e26ba1d0f81adfecdfc .

I don't think it is appropriate to avoid auto-stop for all HP uhci
devices. So add one  tag for the virtual uhci devices, it is used
to replace "wait_for_hp" in the auto-stop case.

Signed-off-by: Li, Zhen-Hua <zhen-hual@hp.com>
---
 drivers/usb/host/uhci-hcd.h |    1 +
 drivers/usb/host/uhci-hub.c |    2 +-
 drivers/usb/host/uhci-pci.c |   21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 6f986d8..915d5df 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -425,6 +425,7 @@ struct uhci_hcd {
 	/* Silicon quirks */
 	unsigned int oc_low:1;			/* OverCurrent bit active low */
 	unsigned int wait_for_hp:1;		/* Wait for HP port reset */
+	unsigned int virtual_device:1;		/* For some virtual devices */
 	unsigned int big_endian_mmio:1;		/* Big endian registers */
 	unsigned int big_endian_desc:1;		/* Big endian descriptors */
 
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index 9189bc9..da00754 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -226,7 +226,7 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf)
 		if (any_ports_active(uhci))
 			uhci->rh_state = UHCI_RH_RUNNING;
 		else if (time_after_eq(jiffies, uhci->auto_stop_time) &&
-				!uhci->wait_for_hp)
+				!uhci->virtual_device)
 			suspend_rh(uhci, UHCI_RH_AUTO_STOPPED);
 		break;
 
diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c
index c300bd2f7..68e6d92 100644
--- a/drivers/usb/host/uhci-pci.c
+++ b/drivers/usb/host/uhci-pci.c
@@ -110,6 +110,24 @@ static int uhci_pci_global_suspend_mode_is_broken(struct uhci_hcd *uhci)
 	return 0;
 }
 
+static int uhci_virtual_device_ids[][2] = {
+	{0x103c, 0x3300},
+	{0, 0},
+};
+static int uhci_is_virtual_device(struct uhci_hcd *uhci)
+{
+	int i;
+	struct pci_dev *dev;
+
+	dev = to_pci_dev(uhci_dev(uhci));
+	for (i = 0; uhci_virtual_device_ids[i][0] != 0; i++) {
+		if (dev->vendor == uhci_virtual_device_ids[i][0]
+			    && dev->device == uhci_virtual_device_ids[i][1])
+			return 1;
+	}
+	return 0;
+}
+
 static int uhci_pci_init(struct usb_hcd *hcd)
 {
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
@@ -129,6 +147,9 @@ static int uhci_pci_init(struct usb_hcd *hcd)
 	if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_HP)
 		uhci->wait_for_hp = 1;
 
+	if (uhci_is_virtual_device(uhci))
+		uhci->virtual_device = 1;
+
 	/* Set up pointers to PCI-specific functions */
 	uhci->reset_hc = uhci_pci_reset_hc;
 	uhci->check_and_reset_hc = uhci_pci_check_and_reset_hc;
-- 
1.7.10.4


             reply	other threads:[~2013-06-26  6:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  6:29 Li, Zhen-Hua [this message]
2013-06-26 19:17 ` Alan Stern
2013-06-27  1:17   ` Li, Zhen-Hua (USL-China)
2013-06-27 15:52     ` Alan Stern
2013-06-28  1:05       ` Li, Zhen-Hua (USL-China)
2013-06-28 14:22         ` Alan Stern
2013-07-01  1:11           ` ZhenHua
2013-07-01 14:29             ` Alan Stern
2013-07-24 22:50 ` Greg KH

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=1372228185-11518-1-git-send-email-zhen-hual@hp.com \
    --to=zhen-hual@hp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®