linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git
@ 2005-11-23 23:43 ` Greg Kroah-Hartman
  2005-11-23 23:43   ` [patch 01/22] Small fixes to driver core Greg Kroah-Hartman
                     ` (22 more replies)
  0 siblings, 23 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:43 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel

Here are a few PCI, USB, hwmon, and documentation patches against your
latest git tree, they have all been in the past few -mm releases just
fine.

The big changes in here are some ehci and ohci fixes to handle suspend
better (there is still one more pending patch to get it all working
completely, but that needs more testing before I send it to you.)

thanks,

greg k-h

 MAINTAINERS                        |   26 +
 arch/i386/pci/common.c             |    6 
 arch/i386/pci/direct.c             |    4 
 arch/i386/pci/i386.c               |    9 
 drivers/base/bus.c                 |   21 -
 drivers/base/dd.c                  |   10 
 drivers/hwmon/hdaps.c              |    4 
 drivers/hwmon/it87.c               |    9 
 drivers/hwmon/lm78.c               |    4 
 drivers/hwmon/w83627hf.c           |   10 
 drivers/pci/hotplug/pciehp.h       |    1 
 drivers/pci/hotplug/pciehp_ctrl.c  |   15 -
 drivers/pci/hotplug/pciehp_hpc.c   |   12 
 drivers/pci/pci-acpi.c             |    3 
 drivers/usb/core/hcd-pci.c         |   38 ++
 drivers/usb/core/hub.c             |    3 
 drivers/usb/host/ehci-hcd.c        |  158 +++++------
 drivers/usb/host/ehci-hub.c        |    7 
 drivers/usb/host/ehci-pci.c        |  515 +++++++++++++++++--------------------
 drivers/usb/host/ohci-pci.c        |   53 +--
 drivers/usb/media/sn9c102_core.c   |    4 
 drivers/usb/serial/ftdi_sio.c      |    2 
 drivers/usb/serial/ftdi_sio.h      |    9 
 drivers/usb/serial/ipw.c           |    2 
 drivers/usb/storage/unusual_devs.h |   11 
 include/linux/usb.h                |    3 
 26 files changed, 494 insertions(+), 445 deletions(-)


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 01/22] Small fixes to driver core
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
@ 2005-11-23 23:43   ` Greg Kroah-Hartman
  2005-11-23 23:43   ` [patch 02/22] MTD git tree location added to MAINTAINERS Greg Kroah-Hartman
                     ` (21 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:43 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, stern

[-- Attachment #1: small-fixups-to-driver-core.patch --]
[-- Type: text/plain, Size: 2947 bytes --]

From: Alan Stern <stern@rowland.harvard.edu>


This patch (as603) makes a few small fixes to the driver core:

Change spin_lock_irq for a klist lock to spin_lock;

Fix reference count leaks;

Minor spelling and formatting changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by Patrick Mochel <mochel@digitalimplant.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/base/bus.c |   21 +++++++++------------
 drivers/base/dd.c  |    8 +++-----
 2 files changed, 12 insertions(+), 17 deletions(-)

--- usb-2.6.orig/drivers/base/bus.c
+++ usb-2.6/drivers/base/bus.c
@@ -133,7 +133,7 @@ static struct kobj_type ktype_bus = {
 decl_subsys(bus, &ktype_bus, NULL);
 
 
-/* Manually detach a device from it's associated driver. */
+/* Manually detach a device from its associated driver. */
 static int driver_helper(struct device *dev, void *data)
 {
 	const char *name = data;
@@ -151,14 +151,13 @@ static ssize_t driver_unbind(struct devi
 	int err = -ENODEV;
 
 	dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
-	if ((dev) &&
-	    (dev->driver == drv)) {
+	if (dev && dev->driver == drv) {
 		device_release_driver(dev);
 		err = count;
 	}
-	if (err)
-		return err;
-	return count;
+	put_device(dev);
+	put_bus(bus);
+	return err;
 }
 static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
 
@@ -175,16 +174,14 @@ static ssize_t driver_bind(struct device
 	int err = -ENODEV;
 
 	dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
-	if ((dev) &&
-	    (dev->driver == NULL)) {
+	if (dev && dev->driver == NULL) {
 		down(&dev->sem);
 		err = driver_probe_device(drv, dev);
 		up(&dev->sem);
-		put_device(dev);
 	}
-	if (err)
-		return err;
-	return count;
+	put_device(dev);
+	put_bus(bus);
+	return err;
 }
 static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
 
--- usb-2.6.orig/drivers/base/dd.c
+++ usb-2.6/drivers/base/dd.c
@@ -62,7 +62,6 @@ void device_bind_driver(struct device * 
  *	because we don't know the format of the ID structures, nor what
  *	is to be considered a match and what is not.
  *
- *
  *	This function returns 1 if a match is found, an error if one
  *	occurs (that is not -ENODEV or -ENXIO), and 0 otherwise.
  *
@@ -158,7 +157,6 @@ static int __driver_attach(struct device
 		driver_probe_device(drv, dev);
 	up(&dev->sem);
 
-
 	return 0;
 }
 
@@ -225,15 +223,15 @@ void driver_detach(struct device_driver 
 	struct device * dev;
 
 	for (;;) {
-		spin_lock_irq(&drv->klist_devices.k_lock);
+		spin_lock(&drv->klist_devices.k_lock);
 		if (list_empty(&drv->klist_devices.k_list)) {
-			spin_unlock_irq(&drv->klist_devices.k_lock);
+			spin_unlock(&drv->klist_devices.k_lock);
 			break;
 		}
 		dev = list_entry(drv->klist_devices.k_list.prev,
 				struct device, knode_driver.n_node);
 		get_device(dev);
-		spin_unlock_irq(&drv->klist_devices.k_lock);
+		spin_unlock(&drv->klist_devices.k_lock);
 
 		down(&dev->sem);
 		if (dev->driver == drv)

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 02/22] MTD git tree location added to MAINTAINERS
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
  2005-11-23 23:43   ` [patch 01/22] Small fixes to driver core Greg Kroah-Hartman
@ 2005-11-23 23:43   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 03/22] Clarify T: field in MAINTAINERS Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:43 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, jwboyer

[-- Attachment #1: mtd-git-tree-location-added-to-maintainers.patch --]
[-- Type: text/plain, Size: 609 bytes --]

From: Josh Boyer <jwboyer@gmail.com>

Here's the MTD one.  More later as I find them.

Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

diff --git a/MAINTAINERS b/MAINTAINERS
index c5cf7d7..1e84be3 100644
---
 MAINTAINERS |    1 +
 1 file changed, 1 insertion(+)

--- usb-2.6.orig/MAINTAINERS
+++ usb-2.6/MAINTAINERS
@@ -1695,6 +1695,7 @@ P:	David Woodhouse
 M:	dwmw2@infradead.org
 W:	http://www.linux-mtd.infradead.org/
 L:	linux-mtd@lists.infradead.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git
 S:	Maintained
 
 MICROTEK X6 SCANNER

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 03/22] Clarify T: field in MAINTAINERS
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
  2005-11-23 23:43   ` [patch 01/22] Small fixes to driver core Greg Kroah-Hartman
  2005-11-23 23:43   ` [patch 02/22] MTD git tree location added to MAINTAINERS Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 04/22] Add more SCM trees to MAINTAINERS Greg Kroah-Hartman
                     ` (19 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, scjody

[-- Attachment #1: clarify-t-field-in-maintainers.patch --]
[-- Type: text/plain, Size: 802 bytes --]

From: Jody McIntyre <scjody@steamballoon.com>

Pavel Machek points out that for git repos, what we include is not
actually a URL.  It is undesirable to use a URL since git repos can be
accessed in many different ways.

Signed-off-by: Jody McIntyre <scjody@steamballoon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 MAINTAINERS |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- usb-2.6.orig/MAINTAINERS
+++ usb-2.6/MAINTAINERS
@@ -58,7 +58,7 @@ P: Person
 M: Mail patches to
 L: Mailing list that is relevant to this area
 W: Web-page with status/info
-T: SCM tree type and URL.  Type is one of: git, hg, quilt.
+T: SCM tree type and location.  Type is one of: git, hg, quilt.
 S: Status, one of the following:
 
 	Supported:	Someone is actually paid to look after this.

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 04/22] Add more SCM trees to MAINTAINERS
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (2 preceding siblings ...)
  2005-11-23 23:44   ` [patch 03/22] Clarify T: field in MAINTAINERS Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 05/22] hwmon: Fix missing boundary check when setting W83627THF in0 limits Greg Kroah-Hartman
                     ` (18 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, jwboyer

[-- Attachment #1: add-more-scm-trees-to-maintainers.patch --]
[-- Type: text/plain, Size: 4522 bytes --]

From: Josh Boyer <jwboyer@gmail.com>

Greg requested a patch to update MAINTAINERS with more SCM entries.
The patch below is what I've found so far.

Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 MAINTAINERS |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- usb-2.6.orig/MAINTAINERS
+++ usb-2.6/MAINTAINERS
@@ -227,6 +227,7 @@ AGPGART DRIVER
 P:	Dave Jones
 M:	davej@codemonkey.org.uk
 W:	http://www.codemonkey.org.uk/projects/agp/
+T:	git kernel.org:/pub/scm/linux/kernel/git/davej/agpgart.git
 S:	Maintained
 
 AHA152X SCSI DRIVER
@@ -384,6 +385,7 @@ P:	David Woodhouse
 M:	dwmw2@infradead.org
 L:	linux-audit@redhat.com
 W:	http://people.redhat.com/sgrubb/audit/
+T:	git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S:	Maintained
 
 AX.25 NETWORK LAYER
@@ -432,6 +434,7 @@ L:	bluez-devel@lists.sf.net
 W:	http://bluez.sf.net
 W:	http://www.bluez.org
 W:	http://www.holtmann.org/linux/bluetooth/
+T:	git kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
 S:	Maintained
 
 BLUETOOTH RFCOMM LAYER
@@ -547,6 +550,7 @@ P:	Steve French
 M:	sfrench@samba.org
 L:	samba-technical@lists.samba.org
 W:	http://us1.samba.org/samba/Linux_CIFS_client.html
+T:	git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
 S:	Supported	
 
 CIRRUS LOGIC GENERIC FBDEV DRIVER
@@ -608,6 +612,7 @@ P:	Dave Jones
 M:	davej@codemonkey.org.uk
 L:	cpufreq@lists.linux.org.uk
 W:	http://www.codemonkey.org.uk/projects/cpufreq/
+T:	git kernel.org/pub/scm/linux/kernel/davej/cpufreq.git
 S:	Maintained
 
 CPUID/MSR DRIVER
@@ -641,6 +646,7 @@ M:	herbert@gondor.apana.org.au
 P:	David S. Miller
 M:	davem@davemloft.net
 L:	linux-crypto@vger.kernel.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
 S:	Maintained
 
 CYBERPRO FB DRIVER
@@ -1185,6 +1191,7 @@ P:	Bartlomiej Zolnierkiewicz
 M:	B.Zolnierkiewicz@elka.pw.edu.pl
 L:	linux-kernel@vger.kernel.org
 L:	linux-ide@vger.kernel.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git
 S:	Maintained
 
 IDE/ATAPI CDROM DRIVER
@@ -1279,6 +1286,7 @@ P:	Vojtech Pavlik
 M:	vojtech@suse.cz
 L:	linux-input@atrey.karlin.mff.cuni.cz
 L:	linux-joystick@atrey.karlin.mff.cuni.cz
+T:	git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
 S:	Maintained
 
 INOTIFY
@@ -1392,6 +1400,7 @@ P:	Kai Germaschewski
 M:	kai.germaschewski@gmx.de
 L:	isdn4linux@listserv.isdn4linux.de
 W:	http://www.isdn4linux.de
+T:	git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git
 S:	Maintained
 
 ISDN SUBSYSTEM (Eicon active card driver)
@@ -1420,6 +1429,7 @@ P:	Dave Kleikamp
 M:	shaggy@austin.ibm.com
 L:	jfs-discussion@lists.sourceforge.net
 W:	http://jfs.sourceforge.net/
+T:	git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
 S:	Supported
 
 KCONFIG
@@ -1534,6 +1544,7 @@ P:	Paul Mackerras
 M:	paulus@samba.org
 W:	http://www.penguinppc.org/
 L:	linuxppc-dev@ozlabs.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git
 S:	Supported
 
 LINUX FOR POWER MACINTOSH
@@ -1601,6 +1612,7 @@ P:	Chris Wright
 M:	chrisw@osdl.org
 L:	linux-security-module@wirex.com
 W:	http://lsm.immunix.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
 S:	Supported
 
 LM83 HARDWARE MONITOR DRIVER
@@ -1816,6 +1828,7 @@ M:	yoshfuji@linux-ipv6.org
 P:	Patrick McHardy
 M:	kaber@coreworks.de
 L:	netdev@vger.kernel.org
+T:	git kernel.org:/pub/scm/linux/kernel/davem/net-2.6.git
 S:	Maintained
 
 IPVS
@@ -1867,6 +1880,7 @@ M:	aia21@cantab.net
 L:	linux-ntfs-dev@lists.sourceforge.net
 L:	linux-kernel@vger.kernel.org
 W:	http://linux-ntfs.sf.net/
+T:	git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
 S:	Maintained
 
 NVIDIA (RIVA) FRAMEBUFFER DRIVER
@@ -2390,6 +2404,7 @@ P:	Anton Blanchard
 M:	anton@samba.org
 L:	sparclinux@vger.kernel.org
 L:	ultralinux@vger.kernel.org
+T:	git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git
 S:	Maintained
 
 SHARP LH SUPPORT (LH7952X & LH7A40X)
@@ -2528,6 +2543,7 @@ P:      Adrian Bunk
 M:      trivial@kernel.org
 L:      linux-kernel@vger.kernel.org
 W:      http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/
+T:      git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git
 S:      Maintained
 
 TMS380 TOKEN-RING NETWORK DRIVER
@@ -2861,6 +2877,7 @@ P:      Latchesar Ionkov
 M:      lucho@ionkov.net
 L:      v9fs-developer@lists.sourceforge.net
 W:      http://v9fs.sf.net
+T:      git kernel.org:/pub/scm/linux/kernel/ericvh/v9fs-devel.git
 S:      Maintained
 
 VIDEO FOR LINUX

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 05/22] hwmon: Fix missing boundary check when setting W83627THF in0 limits
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (3 preceding siblings ...)
  2005-11-23 23:44   ` [patch 04/22] Add more SCM trees to MAINTAINERS Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 06/22] hwmon: Fix lm78 VID conversion Greg Kroah-Hartman
                     ` (17 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, khali, Ymu

[-- Attachment #1: hwmon-w83627hf-missing-in0-limit-check.patch --]
[-- Type: text/plain, Size: 1201 bytes --]

From: Yuan Mu <Ymu@winbond.com.tw>

Add SENSORS_LIMIT in store VCore limit functions. This fixes a potential
u8 overflow on out-of-range user input.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/hwmon/w83627hf.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- usb-2.6.orig/drivers/hwmon/w83627hf.c
+++ usb-2.6/drivers/hwmon/w83627hf.c
@@ -456,7 +456,9 @@ static ssize_t store_regs_in_min0(struct
 		(w83627thf == data->type || w83637hf == data->type))
 
 		/* use VRM9 calculation */
-		data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+		data->in_min[0] =
+			SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
+					255);
 	else
 		/* use VRM8 (standard) calculation */
 		data->in_min[0] = IN_TO_REG(val);
@@ -481,7 +483,9 @@ static ssize_t store_regs_in_max0(struct
 		(w83627thf == data->type || w83637hf == data->type))
 		
 		/* use VRM9 calculation */
-		data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+		data->in_max[0] =
+			SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
+					255);
 	else
 		/* use VRM8 (standard) calculation */
 		data->in_max[0] = IN_TO_REG(val);

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 06/22] hwmon: Fix lm78 VID conversion
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (4 preceding siblings ...)
  2005-11-23 23:44   ` [patch 05/22] hwmon: Fix missing boundary check when setting W83627THF in0 limits Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 07/22] hwmon: Fix missing it87 fan div init Greg Kroah-Hartman
                     ` (16 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, khali

[-- Attachment #1: hwmon-lm78-fix-vid.patch --]
[-- Type: text/plain, Size: 882 bytes --]

From: Jean Delvare <khali@linux-fr.org>

Fix the lm78 VID reading, which I accidentally broke while making
this driver use the common vid_from_reg function rather than
reimplementing its own in 2.6.14-rc1.

I'm not proud of it, trust me.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/hwmon/lm78.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- usb-2.6.orig/drivers/hwmon/lm78.c
+++ usb-2.6/drivers/hwmon/lm78.c
@@ -451,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, sh
 static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct lm78_data *data = lm78_update_device(dev);
-	return sprintf(buf, "%d\n", vid_from_reg(82, data->vid));
+	return sprintf(buf, "%d\n", vid_from_reg(data->vid, 82));
 }
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 07/22] hwmon: Fix missing it87 fan div init
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (5 preceding siblings ...)
  2005-11-23 23:44   ` [patch 06/22] hwmon: Fix lm78 VID conversion Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 08/22] hwmon: hdaps missing an axis Greg Kroah-Hartman
                     ` (15 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, khali

[-- Attachment #1: hwmon-fix-missing-it87-fan-div-init.patch --]
[-- Type: text/plain, Size: 1361 bytes --]

From: Jean Delvare <khali@linux-fr.org>

Fix a bug where setting the low fan speed limits will not work if no
data was ever read through the sysfs interface and the fan clock
dividers have not been explicitely set yet either. The reason is that
data->fan_div[nr] may currently be used before it is initialized from
the chip register values. The fix is to explicitely initialize
data->fan_div[nr] before using it.

Bug reported, and fix tested, by Nicolas Mailhot.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/hwmon/it87.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- usb-2.6.orig/drivers/hwmon/it87.c
+++ usb-2.6/drivers/hwmon/it87.c
@@ -522,8 +522,15 @@ static ssize_t set_fan_min(struct device
 	struct i2c_client *client = to_i2c_client(dev);
 	struct it87_data *data = i2c_get_clientdata(client);
 	int val = simple_strtol(buf, NULL, 10);
+	u8 reg = it87_read_value(client, IT87_REG_FAN_DIV);
 
 	down(&data->update_lock);
+	switch (nr) {
+	case 0: data->fan_div[nr] = reg & 0x07; break;
+	case 1: data->fan_div[nr] = (reg >> 3) & 0x07; break;
+	case 2: data->fan_div[nr] = (reg & 0x40) ? 3 : 1; break;
+	}
+
 	data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
 	it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]);
 	up(&data->update_lock);

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 08/22] hwmon: hdaps missing an axis
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (6 preceding siblings ...)
  2005-11-23 23:44   ` [patch 07/22] hwmon: Fix missing it87 fan div init Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 09/22] PCI: trivial printk updates in common.c Greg Kroah-Hartman
                     ` (14 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, linux-usb-devel, eugen, rml, khali

[-- Attachment #1: hwmon-hdaps-missing-an-axis.patch --]
[-- Type: text/plain, Size: 806 bytes --]

From: Eugeniy Meshcheryakov <eugen@univ.kiev.ua>

Trivial patch to report both hdaps axises to the joystick device, not
just the X axis.

Signed-off-by: Robert Love <rml@novell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/hwmon/hdaps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- usb-2.6.orig/drivers/hwmon/hdaps.c
+++ usb-2.6/drivers/hwmon/hdaps.c
@@ -570,7 +570,7 @@ static int __init hdaps_init(void)
 	hdaps_idev->evbit[0] = BIT(EV_ABS);
 	input_set_abs_params(hdaps_idev, ABS_X,
 			-256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
-	input_set_abs_params(hdaps_idev, ABS_X,
+	input_set_abs_params(hdaps_idev, ABS_Y,
 			-256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
 
 	input_register_device(hdaps_idev);

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 09/22] PCI: trivial printk updates in common.c
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (7 preceding siblings ...)
  2005-11-23 23:44   ` [patch 08/22] hwmon: hdaps missing an axis Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 10/22] PCI Express Hotplug: clear sticky power-fault bit Greg Kroah-Hartman
                     ` (13 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, linux-usb-devel, daniel.marjamaki

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: pci-trivial-printk-updates-in-common.c.patch --]
[-- Type: text/plain; charset=unknown-8bit, Size: 941 bytes --]

From: Daniel Marjamäkia <daniel.marjamaki@comhem.se>


Modified common.c so it's using the appropriate KERN_* in printk() calls.

Signed-off-by: Daniel Marjamäkia <daniel.marjamaki@comhem.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/i386/pci/common.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- usb-2.6.orig/arch/i386/pci/common.c
+++ usb-2.6/arch/i386/pci/common.c
@@ -132,7 +132,7 @@ struct pci_bus * __devinit pcibios_scan_
 		}
 	}
 
-	printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
+	printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
 
 	return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
 }
@@ -144,7 +144,7 @@ static int __init pcibios_init(void)
 	struct cpuinfo_x86 *c = &boot_cpu_data;
 
 	if (!raw_pci_ops) {
-		printk("PCI: System does not support PCI\n");
+		printk(KERN_WARNING "PCI: System does not support PCI\n");
 		return 0;
 	}
 

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 10/22] PCI Express Hotplug: clear sticky power-fault bit
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (8 preceding siblings ...)
  2005-11-23 23:44   ` [patch 09/22] PCI: trivial printk updates in common.c Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:44   ` [patch 11/22] PCI: remove bogus resource collision error Greg Kroah-Hartman
                     ` (12 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, rajesh.shah

[-- Attachment #1: pci-express-hotplug-clear-sticky-power-fault-bit.patch --]
[-- Type: text/plain, Size: 3310 bytes --]

From: Rajesh Shah <rajesh.shah@intel.com>


Per the PCI Express spec, the power-fault-detected bit in the
slot status register can be set anytime hardware detects a power
fault, regardless of whether the slot has a device populated in
it or not. This bit is sticky and must be explicitly cleared.
This patch is needed to allow hot-add after such a power fault
has been detected.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/hotplug/pciehp.h      |    1 -
 drivers/pci/hotplug/pciehp_ctrl.c |   15 ++-------------
 drivers/pci/hotplug/pciehp_hpc.c  |   10 +++++++++-
 3 files changed, 11 insertions(+), 15 deletions(-)

--- usb-2.6.orig/drivers/pci/hotplug/pciehp.h
+++ usb-2.6/drivers/pci/hotplug/pciehp.h
@@ -59,7 +59,6 @@ struct slot {
 	struct slot *next;
 	u8 bus;
 	u8 device;
-	u16 status;
 	u32 number;
 	u8 state;
 	struct timer_list task_event;
--- usb-2.6.orig/drivers/pci/hotplug/pciehp_ctrl.c
+++ usb-2.6/drivers/pci/hotplug/pciehp_ctrl.c
@@ -207,7 +207,6 @@ u8 pciehp_handle_power_fault(u8 hp_slot,
 		 * power fault Cleared
 		 */
 		info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot);
-		p_slot->status = 0x00;
 		taskInfo->event_type = INT_POWER_FAULT_CLEAR;
 	} else {
 		/*
@@ -215,8 +214,6 @@ u8 pciehp_handle_power_fault(u8 hp_slot,
 		 */
 		info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot);
 		taskInfo->event_type = INT_POWER_FAULT;
-		/* set power fault status for this board */
-		p_slot->status = 0xFF;
 		info("power fault bit %x set\n", hp_slot);
 	}
 	if (rc)
@@ -317,13 +314,10 @@ static int board_added(struct slot *p_sl
 		return rc;
 	}
 
-	dbg("%s: slot status = %x\n", __FUNCTION__, p_slot->status);
-
 	/* Check for a power fault */
-	if (p_slot->status == 0xFF) {
-		/* power fault occurred, but it was benign */
+	if (p_slot->hpc_ops->query_power_fault(p_slot)) {
+		dbg("%s: power fault detected\n", __FUNCTION__);
 		rc = POWER_FAILURE;
-		p_slot->status = 0;
 		goto err_exit;
 	}
 
@@ -334,8 +328,6 @@ static int board_added(struct slot *p_sl
 		goto err_exit;
 	}
 
-	p_slot->status = 0;
-
 	/*
 	 * Some PCI Express root ports require fixup after hot-plug operation.
 	 */
@@ -382,9 +374,6 @@ static int remove_board(struct slot *p_s
 
 	dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
 
-	/* Change status to shutdown */
-	p_slot->status = 0x01;
-
 	/* Wait for exclusive access to hardware */
 	down(&ctrl->crit_sect);
 
--- usb-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ usb-2.6/drivers/pci/hotplug/pciehp_hpc.c
@@ -750,7 +750,7 @@ static int hpc_power_on_slot(struct slot
 {
 	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
-	u16 slot_ctrl;
+	u16 slot_ctrl, slot_status;
 
 	int retval = 0;
 
@@ -767,6 +767,14 @@ static int hpc_power_on_slot(struct slot
 		return -1;
 	}
 
+	/* Clear sticky power-fault bit from previous power failures */
+	hp_register_read_word(php_ctlr->pci_dev,
+			SLOT_STATUS(slot->ctrl->cap_base), slot_status);
+	slot_status &= PWR_FAULT_DETECTED;
+	if (slot_status)
+		hp_register_write_word(php_ctlr->pci_dev,
+			SLOT_STATUS(slot->ctrl->cap_base), slot_status);
+
 	retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), slot_ctrl);
 
 	if (retval) {

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 11/22] PCI: remove bogus resource collision error
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (9 preceding siblings ...)
  2005-11-23 23:44   ` [patch 10/22] PCI Express Hotplug: clear sticky power-fault bit Greg Kroah-Hartman
@ 2005-11-23 23:44   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 12/22] PCI: kernel-doc fix for pci-acpi.c Greg Kroah-Hartman
                     ` (11 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:44 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, rajesh.shah

[-- Attachment #1: pci-remove-bogus-resource-collision-error.patch --]
[-- Type: text/plain, Size: 1541 bytes --]

From: Rajesh Shah <rajesh.shah@intel.com>

When attempting to hotadd a PCI card with a bridge on it, I saw
the kernel reporting resource collision errors even when there were
really no collisions. The problem is that the code doesn't skip
over "invalid" resources with their resource type flag not set.
Others have reported similar problems at boot time and for
non-bridge PCI card hotplug too, where the code flags a
resource collision for disabled ROMs. This patch fixes both
problems.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 arch/i386/pci/i386.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- usb-2.6.orig/arch/i386/pci/i386.c
+++ usb-2.6/arch/i386/pci/i386.c
@@ -221,6 +221,11 @@ int pcibios_enable_resources(struct pci_
 			continue;
 
 		r = &dev->resource[idx];
+		if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
+			continue;
+		if ((idx == PCI_ROM_RESOURCE) &&
+				(!(r->flags & IORESOURCE_ROM_ENABLE)))
+			continue;
 		if (!r->start && r->end) {
 			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
 			return -EINVAL;
@@ -230,8 +235,6 @@ int pcibios_enable_resources(struct pci_
 		if (r->flags & IORESOURCE_MEM)
 			cmd |= PCI_COMMAND_MEMORY;
 	}
-	if (dev->resource[PCI_ROM_RESOURCE].start)
-		cmd |= PCI_COMMAND_MEMORY;
 	if (cmd != old_cmd) {
 		printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
 		pci_write_config_word(dev, PCI_COMMAND, cmd);

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 12/22] PCI: kernel-doc fix for pci-acpi.c
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (10 preceding siblings ...)
  2005-11-23 23:44   ` [patch 11/22] PCI: remove bogus resource collision error Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 13/22] PCI: direct.c: DBG Greg Kroah-Hartman
                     ` (10 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, rdunlap

[-- Attachment #1: pci-kernel-doc-fix-for-pci-acpi.c.patch --]
[-- Type: text/plain, Size: 632 bytes --]

From: Randy Dunlap <rdunlap@xenotime.net>

Fix kernel-doc warning in pci/pci-acpi.c.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/pci/pci-acpi.c |    1 +
 1 file changed, 1 insertion(+)

--- usb-2.6.orig/drivers/pci/pci-acpi.c
+++ usb-2.6/drivers/pci/pci-acpi.c
@@ -178,6 +178,7 @@ EXPORT_SYMBOL(pci_osc_support_set);
 
 /**
  * pci_osc_control_set - commit requested control to Firmware
+ * @handle: acpi_handle for the target ACPI object
  * @flags: driver's requested control bits
  *
  * Attempt to take control from Firmware on requested control bits.

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 13/22] PCI: direct.c: DBG
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (11 preceding siblings ...)
  2005-11-23 23:45   ` [patch 12/22] PCI: kernel-doc fix for pci-acpi.c Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 14/22] USB: SN9C10x driver - bad page state fix Greg Kroah-Hartman
                     ` (9 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, linux-usb-devel, daniel.marjamaki

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: pci-direct.c-dbg.patch --]
[-- Type: text/plain; charset=unknown-8bit, Size: 583 bytes --]

From: Daniel Marjamäki <daniel.marjamaki@comhem.se>


The DBG() call where updated with the appropriate KERN_* symbol.

Signed-off-by: Daniel Marjamäki <daniel.marjamaki@comhem.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/i386/pci/direct.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- usb-2.6.orig/arch/i386/pci/direct.c
+++ usb-2.6/arch/i386/pci/direct.c
@@ -201,7 +201,7 @@ static int __init pci_sanity_check(struc
 			return 1;
 	}
 
-	DBG("PCI: Sanity check failed\n");
+	DBG(KERN_WARNING "PCI: Sanity check failed\n");
 	return 0;
 }
 

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 14/22] USB: SN9C10x driver - bad page state fix
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (12 preceding siblings ...)
  2005-11-23 23:45   ` [patch 13/22] PCI: direct.c: DBG Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 15/22] USB: ftdi_sio: new IDs for KOBIL devices Greg Kroah-Hartman
                     ` (8 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, dwrobel

[-- Attachment #1: usb-sn9c10x-driver-bad-page-state-fix.patch --]
[-- Type: text/plain, Size: 1786 bytes --]

From: Damian Wrobel <dwrobel@ertel.com.pl>


This patch solves the following problem I've already discovered on the
latest 2.6.15-rc1-git1 kernel:

Nov 13 07:37:28 wrobel kernel: Bad page state at free_hot_cold_page (in process 'motion', page c164e020)
Nov 13 07:37:28 wrobel kernel: flags:0x40000400 mapping:00000000 mapcount:0 count:0
Nov 13 07:37:28 wrobel kernel: Backtrace:
Nov 13 07:37:28 wrobel kernel:  [<c0146d86>] bad_page+0x85/0xbe
Nov 13 07:37:28 wrobel kernel:  [<c0147629>] free_hot_cold_page+0x54/0x129
Nov 13 07:37:28 wrobel kernel:  [<c01598c6>] __vunmap+0xa9/0xfe
Nov 13 07:37:28 wrobel kernel:  [<c0154114>] vmalloc_to_page+0x34/0x55
Nov 13 07:37:28 wrobel kernel:  [<c0159942>] vfree+0x27/0x35
Nov 13 07:37:28 wrobel kernel:  [<f8a20292>]  sn9c102_release_buffers+0x30/0x3f [sn9c102]
Nov 13 07:37:28 wrobel kernel:  [<f8a231c2>] sn9c102_release+0x37/0xeb [sn9c102]
Nov 13 07:37:28 wrobel kernel:  [<c0163e74>] __fput+0xa9/0x1aa
Nov 13 07:37:28 wrobel kernel:  [<c01624f7>] filp_close+0x49/0x6d
Nov 13 07:37:30 wrobel kernel:  [<c016258f>] sys_close+0x74/0x95
Nov 13 07:37:30 wrobel kernel:  [<c0102ef9>] syscall_call+0x7/0xb
Nov 13 07:37:31 wrobel kernel: Trying to fix it up, but a reboot is needed

Signed-off-by: Damian Wrobel <dwrobel@ertel.com.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/media/sn9c102_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- usb-2.6.orig/drivers/usb/media/sn9c102_core.c
+++ usb-2.6/drivers/usb/media/sn9c102_core.c
@@ -199,7 +199,7 @@ static void sn9c102_release_buffers(stru
 {
 	if (cam->nbuffers) {
 		rvfree(cam->frame[0].bufmem,
-		       cam->nbuffers * cam->frame[0].buf.length);
+		       cam->nbuffers * PAGE_ALIGN(cam->frame[0].buf.length));
 		cam->nbuffers = 0;
 	}
 }

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 15/22] USB: ftdi_sio: new IDs for KOBIL devices
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (13 preceding siblings ...)
  2005-11-23 23:45   ` [patch 14/22] USB: SN9C10x driver - bad page state fix Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 16/22] USB: EHCI updates Greg Kroah-Hartman
                     ` (7 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, abbotti

[-- Attachment #1: usb-ftdi_sio-new-ids-for-kobil-devices.patch --]
[-- Type: text/plain, Size: 1419 bytes --]

From: Ian Abbott <abbotti@mev.co.uk>

This patch adds two new devices to the ftdi_sio driver's device ID
table.  The device IDs were supplied by Stefan Nies of KOBIL Systems for
two of their devices using the FTDI chip.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/usb/serial/ftdi_sio.c |    2 ++
 drivers/usb/serial/ftdi_sio.h |    7 +++++++
 2 files changed, 9 insertions(+)

--- usb-2.6.orig/drivers/usb/serial/ftdi_sio.c
+++ usb-2.6/drivers/usb/serial/ftdi_sio.c
@@ -475,6 +475,8 @@ static struct usb_device_id id_table_com
 	{ USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) },
+	{ USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) },
+	{ USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) },
 	{ },					/* Optional parameter entry */
 	{ }					/* Terminating entry */
 };
--- usb-2.6.orig/drivers/usb/serial/ftdi_sio.h
+++ usb-2.6/drivers/usb/serial/ftdi_sio.h
@@ -128,6 +128,13 @@
 #define SEALEVEL_2803_8_PID	0X2883 	/* SeaLINK+8 (2803) Port 8 */
 
 /*
+ * The following are the values for two KOBIL chipcard terminals.
+ */
+#define KOBIL_VID		0x0d46	/* KOBIL Vendor ID */
+#define KOBIL_CONV_B1_PID	0x2020	/* KOBIL Konverter for B1 */
+#define KOBIL_CONV_KAAN_PID	0x2021	/* KOBIL_Konverter for KAAN */
+
+/*
  * DSS-20 Sync Station for Sony Ericsson P800
  */
  

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 16/22] USB: EHCI updates
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (14 preceding siblings ...)
  2005-11-23 23:45   ` [patch 15/22] USB: ftdi_sio: new IDs for KOBIL devices Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 17/22] USB: EHCI updates mostly whitespace cleanups Greg Kroah-Hartman
                     ` (6 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, david-b

[-- Attachment #1: usb-ehci-updates.patch --]
[-- Type: text/plain, Size: 6324 bytes --]

From: David Brownell <david-b@pacbell.net>

This fixes some bugs in EHCI suspend/resume that joined us over the past
few releases (as usbcore, PCI, pmcore, and other components evolved):

  - Removes suspend and resume recursion from the EHCI driver, getting
    rid of the USB_SUSPEND special casing.

  - Updates the wakeup mechanism to work again; there's a newish usbcore
    call it needs to use.

  - Provide simpler tests for "do we need to restart from scratch", to
    address another case where PCI Vaux was lost.  (In this case it was
    restoring a swsusp snapshot, but there could be others.)

Un-exports a symbol that was temporarily exported.

A notable change from previous version is that this doesn't move
the spinlock init, so there's still a resume/reinit path bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/hub.c      |    1 
 drivers/usb/host/ehci-hcd.c |    3 -
 drivers/usb/host/ehci-hub.c |    7 ++++
 drivers/usb/host/ehci-pci.c |   77 +++++++++++++++++++++-----------------------
 4 files changed, 46 insertions(+), 42 deletions(-)

--- usb-2.6.orig/drivers/usb/host/ehci-hcd.c
+++ usb-2.6/drivers/usb/host/ehci-hcd.c
@@ -636,9 +636,8 @@ static irqreturn_t ehci_irq (struct usb_
 			 * stop that signaling.
 			 */
 			ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
-			mod_timer (&hcd->rh_timer,
-					ehci->reset_done [i] + 1);
 			ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
+			usb_hcd_resume_root_hub(hcd);
 		}
 	}
 
--- usb-2.6.orig/drivers/usb/host/ehci-pci.c
+++ usb-2.6/drivers/usb/host/ehci-pci.c
@@ -235,10 +235,11 @@ static void ehci_pci_stop (struct usb_hc
 
 /* suspend/resume, section 4.3 */
 
-/* These routines rely on the bus (pci, platform, etc)
+/* These routines rely on the PCI bus glue
  * to handle powerdown and wakeup, and currently also on
  * transceivers that don't need any software attention to set up
  * the right sort of wakeup.
+ * Also they depend on separate root hub suspend/resume.
  */
 
 static int ehci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
@@ -246,17 +247,9 @@ static int ehci_pci_suspend (struct usb_
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
 
 	if (time_before (jiffies, ehci->next_statechange))
-		msleep (100);
-
-#ifdef	CONFIG_USB_SUSPEND
-	(void) usb_suspend_device (hcd->self.root_hub);
-#else
-	usb_lock_device (hcd->self.root_hub);
-	(void) ehci_bus_suspend (hcd);
-	usb_unlock_device (hcd->self.root_hub);
-#endif
+		msleep (10);
 
-	// save (PCI) FLADJ in case of Vaux power loss
+	// could save FLADJ in case of Vaux power loss
 	// ... we'd only use it to handle clock skew
 
 	return 0;
@@ -269,13 +262,18 @@ static int ehci_pci_resume (struct usb_h
 	struct usb_device	*root = hcd->self.root_hub;
 	int			retval = -EINVAL;
 
-	// maybe restore (PCI) FLADJ
+	// maybe restore FLADJ
 
 	if (time_before (jiffies, ehci->next_statechange))
 		msleep (100);
 
+	/* If CF is clear, we lost PCI Vaux power and need to restart.  */
+	if (readl (&ehci->regs->configured_flag) != cpu_to_le32(FLAG_CF))
+		goto restart;
+
 	/* If any port is suspended (or owned by the companion),
 	 * we know we can/must resume the HC (and mustn't reset it).
+	 * We just defer that to the root hub code.
 	 */
 	for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) {
 		u32	status;
@@ -283,42 +281,43 @@ static int ehci_pci_resume (struct usb_h
 		status = readl (&ehci->regs->port_status [port]);
 		if (!(status & PORT_POWER))
 			continue;
-		if (status & (PORT_SUSPEND | PORT_OWNER)) {
-			down (&hcd->self.root_hub->serialize);
-			retval = ehci_bus_resume (hcd);
-			up (&hcd->self.root_hub->serialize);
-			break;
+		if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {
+			usb_hcd_resume_root_hub(hcd);
+			return 0;
 		}
+	}
+
+restart:
+	ehci_dbg(ehci, "lost power, restarting\n");
+	for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) {
+		port--;
 		if (!root->children [port])
 			continue;
-		dbg_port (ehci, __FUNCTION__, port + 1, status);
 		usb_set_device_state (root->children[port],
 					USB_STATE_NOTATTACHED);
 	}
 
 	/* Else reset, to cope with power loss or flush-to-storage
-	 * style "resume" having activated BIOS during reboot.
+	 * style "resume" having let BIOS kick in during reboot.
 	 */
-	if (port == 0) {
-		(void) ehci_halt (ehci);
-		(void) ehci_reset (ehci);
-		(void) ehci_pci_reset (hcd);
-
-		/* emptying the schedule aborts any urbs */
-		spin_lock_irq (&ehci->lock);
-		if (ehci->reclaim)
-			ehci->reclaim_ready = 1;
-		ehci_work (ehci, NULL);
-		spin_unlock_irq (&ehci->lock);
-
-		/* restart; khubd will disconnect devices */
-		retval = ehci_run (hcd);
-
-		/* here we "know" root ports should always stay powered;
-		 * but some controllers may lose all power.
-		 */
-		ehci_port_power (ehci, 1);
-	}
+	(void) ehci_halt (ehci);
+	(void) ehci_reset (ehci);
+	(void) ehci_pci_reset (hcd);
+
+	/* emptying the schedule aborts any urbs */
+	spin_lock_irq (&ehci->lock);
+	if (ehci->reclaim)
+		ehci->reclaim_ready = 1;
+	ehci_work (ehci, NULL);
+	spin_unlock_irq (&ehci->lock);
+
+	/* restart; khubd will disconnect devices */
+	retval = ehci_run (hcd);
+
+	/* here we "know" root ports should always stay powered;
+	 * but some controllers may lose all power.
+	 */
+	ehci_port_power (ehci, 1);
 
 	return retval;
 }
--- usb-2.6.orig/drivers/usb/host/ehci-hub.c
+++ usb-2.6/drivers/usb/host/ehci-hub.c
@@ -94,6 +94,13 @@ static int ehci_bus_resume (struct usb_h
 		msleep(5);
 	spin_lock_irq (&ehci->lock);
 
+	/* Ideally and we've got a real resume here, and no port's power
+	 * was lost.  (For PCI, that means Vaux was maintained.)  But we
+	 * could instead be restoring a swsusp snapshot -- so that BIOS was
+	 * the last user of the controller, not reset/pm hardware keeping
+	 * state we gave to it.
+	 */
+
 	/* re-init operational registers in case we lost power */
 	if (readl (&ehci->regs->intr_enable) == 0) {
  		/* at least some APM implementations will try to deliver
--- usb-2.6.orig/drivers/usb/core/hub.c
+++ usb-2.6/drivers/usb/core/hub.c
@@ -1669,7 +1669,6 @@ int usb_suspend_device(struct usb_device
 	return 0;
 #endif
 }
-EXPORT_SYMBOL_GPL(usb_suspend_device);
 
 /*
  * If the USB "suspend" state is in use (rather than "global suspend"),

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 17/22] USB: EHCI updates mostly whitespace cleanups
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (15 preceding siblings ...)
  2005-11-23 23:45   ` [patch 16/22] USB: EHCI updates Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 18/22] USB: EHCI updates split init/reinit logic for resume Greg Kroah-Hartman
                     ` (5 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, david-b

[-- Attachment #1: usb-ehci-updates-mostly-whitespace-cleanups.patch --]
[-- Type: text/plain, Size: 14023 bytes --]

From: David Brownell <david-b@pacbell.net>

This cleans up the recent updates to EHCI PCI support:

  - Gets rid of checks for "is this a PCI device", they're no
    longer needed since this is now all PCI-only code.

  - Reduce log spamming:  MWI is only interesting in the atypical
    case that it can actually be used.

  - Whitespace cleanup, as appropriate for a new file with no
    other pending patches.

So other than that minor logging change, no functional updates.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/usb/host/ehci-pci.c |  268 +++++++++++++++++++++-----------------------
 1 file changed, 129 insertions(+), 139 deletions(-)

--- usb-2.6.orig/drivers/usb/host/ehci-pci.c
+++ usb-2.6/drivers/usb/host/ehci-pci.c
@@ -27,7 +27,7 @@
 /* EHCI 0.96 (and later) section 5.1 says how to kick BIOS/SMM/...
  * off the controller (maybe it can boot from highspeed USB disks).
  */
-static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
+static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap)
 {
 	struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
 
@@ -48,7 +48,7 @@ static int bios_handoff (struct ehci_hcd
 				where, cap);
 			// some BIOS versions seem buggy...
 			// return 1;
-			ehci_warn (ehci, "continuing after BIOS bug...\n");
+			ehci_warn(ehci, "continuing after BIOS bug...\n");
 			/* disable all SMIs, and clear "BIOS owns" flag */
 			pci_write_config_dword(pdev, where + 4, 0);
 			pci_write_config_byte(pdev, where + 2, 0);
@@ -59,95 +59,93 @@ static int bios_handoff (struct ehci_hcd
 }
 
 /* called by khubd or root hub init threads */
-static int ehci_pci_reset (struct usb_hcd *hcd)
+static int ehci_pci_reset(struct usb_hcd *hcd)
 {
-	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
+	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
 	u32			temp;
 	unsigned		count = 256/4;
 
 	spin_lock_init (&ehci->lock);
 
 	ehci->caps = hcd->regs;
-	ehci->regs = hcd->regs + HC_LENGTH (readl (&ehci->caps->hc_capbase));
-	dbg_hcs_params (ehci, "reset");
-	dbg_hcc_params (ehci, "reset");
+	ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));
+	dbg_hcs_params(ehci, "reset");
+	dbg_hcc_params(ehci, "reset");
 
 	/* cache this readonly data; minimize chip reads */
-	ehci->hcs_params = readl (&ehci->caps->hcs_params);
+	ehci->hcs_params = readl(&ehci->caps->hcs_params);
 
-	if (hcd->self.controller->bus == &pci_bus_type) {
-		struct pci_dev	*pdev = to_pci_dev(hcd->self.controller);
+	/* NOTE:  only the parts below this line are PCI-specific */
 
-		switch (pdev->vendor) {
-		case PCI_VENDOR_ID_TDI:
-			if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
-				ehci->is_tdi_rh_tt = 1;
-				tdi_reset (ehci);
-			}
-			break;
-		case PCI_VENDOR_ID_AMD:
-			/* AMD8111 EHCI doesn't work, according to AMD errata */
-			if (pdev->device == 0x7463) {
-				ehci_info (ehci, "ignoring AMD8111 (errata)\n");
-				return -EIO;
-			}
-			break;
-		case PCI_VENDOR_ID_NVIDIA:
-			/* NVidia reports that certain chips don't handle
-			 * QH, ITD, or SITD addresses above 2GB.  (But TD,
-			 * data buffer, and periodic schedule are normal.)
-			 */
-			switch (pdev->device) {
-			case 0x003c:	/* MCP04 */
-			case 0x005b:	/* CK804 */
-			case 0x00d8:	/* CK8 */
-			case 0x00e8:	/* CK8S */
-				if (pci_set_consistent_dma_mask(pdev,
-							DMA_31BIT_MASK) < 0)
-					ehci_warn (ehci, "can't enable NVidia "
-						"workaround for >2GB RAM\n");
-				break;
-			}
+	switch (pdev->vendor) {
+	case PCI_VENDOR_ID_TDI:
+		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
+			ehci->is_tdi_rh_tt = 1;
+			tdi_reset(ehci);
+		}
+		break;
+	case PCI_VENDOR_ID_AMD:
+		/* AMD8111 EHCI doesn't work, according to AMD errata */
+		if (pdev->device == 0x7463) {
+			ehci_info(ehci, "ignoring AMD8111 (errata)\n");
+			return -EIO;
+		}
+		break;
+	case PCI_VENDOR_ID_NVIDIA:
+		/* NVidia reports that certain chips don't handle
+		 * QH, ITD, or SITD addresses above 2GB.  (But TD,
+		 * data buffer, and periodic schedule are normal.)
+		 */
+		switch (pdev->device) {
+		case 0x003c:	/* MCP04 */
+		case 0x005b:	/* CK804 */
+		case 0x00d8:	/* CK8 */
+		case 0x00e8:	/* CK8S */
+			if (pci_set_consistent_dma_mask(pdev,
+						DMA_31BIT_MASK) < 0)
+				ehci_warn(ehci, "can't enable NVidia "
+					"workaround for >2GB RAM\n");
 			break;
 		}
+		break;
+	}
 
-		/* optional debug port, normally in the first BAR */
-		temp = pci_find_capability (pdev, 0x0a);
-		if (temp) {
-			pci_read_config_dword(pdev, temp, &temp);
-			temp >>= 16;
-			if ((temp & (3 << 13)) == (1 << 13)) {
-				temp &= 0x1fff;
-				ehci->debug = hcd->regs + temp;
-				temp = readl (&ehci->debug->control);
-				ehci_info (ehci, "debug port %d%s\n",
-					HCS_DEBUG_PORT(ehci->hcs_params),
-					(temp & DBGP_ENABLED)
-						? " IN USE"
-						: "");
-				if (!(temp & DBGP_ENABLED))
-					ehci->debug = NULL;
-			}
+	/* optional debug port, normally in the first BAR */
+	temp = pci_find_capability(pdev, 0x0a);
+	if (temp) {
+		pci_read_config_dword(pdev, temp, &temp);
+		temp >>= 16;
+		if ((temp & (3 << 13)) == (1 << 13)) {
+			temp &= 0x1fff;
+			ehci->debug = hcd->regs + temp;
+			temp = readl(&ehci->debug->control);
+			ehci_info(ehci, "debug port %d%s\n",
+				HCS_DEBUG_PORT(ehci->hcs_params),
+				(temp & DBGP_ENABLED)
+					? " IN USE"
+					: "");
+			if (!(temp & DBGP_ENABLED))
+				ehci->debug = NULL;
 		}
+	}
 
-		temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params));
-	} else
-		temp = 0;
+	temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params));
 
 	/* EHCI 0.96 and later may have "extended capabilities" */
 	while (temp && count--) {
 		u32		cap;
 
-		pci_read_config_dword (to_pci_dev(hcd->self.controller),
+		pci_read_config_dword(to_pci_dev(hcd->self.controller),
 				temp, &cap);
-		ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp);
+		ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp);
 		switch (cap & 0xff) {
 		case 1:			/* BIOS/SMM/... handoff */
-			if (bios_handoff (ehci, temp, cap) != 0)
+			if (bios_handoff(ehci, temp, cap) != 0)
 				return -EOPNOTSUPP;
 			break;
 		case 0:			/* illegal reserved capability */
-			ehci_warn (ehci, "illegal capability!\n");
+			ehci_warn(ehci, "illegal capability!\n");
 			cap = 0;
 			/* FALLTHROUGH */
 		default:		/* unknown */
@@ -156,77 +154,69 @@ static int ehci_pci_reset (struct usb_hc
 		temp = (cap >> 8) & 0xff;
 	}
 	if (!count) {
-		ehci_err (ehci, "bogus capabilities ... PCI problems!\n");
+		ehci_err(ehci, "bogus capabilities ... PCI problems!\n");
 		return -EIO;
 	}
 	if (ehci_is_TDI(ehci))
-		ehci_reset (ehci);
+		ehci_reset(ehci);
 
-	ehci_port_power (ehci, 0);
+	ehci_port_power(ehci, 0);
 
 	/* at least the Genesys GL880S needs fixup here */
 	temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
 	temp &= 0x0f;
 	if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) {
-		ehci_dbg (ehci, "bogus port configuration: "
+		ehci_dbg(ehci, "bogus port configuration: "
 			"cc=%d x pcc=%d < ports=%d\n",
 			HCS_N_CC(ehci->hcs_params),
 			HCS_N_PCC(ehci->hcs_params),
 			HCS_N_PORTS(ehci->hcs_params));
 
-		if (hcd->self.controller->bus == &pci_bus_type) {
-			struct pci_dev	*pdev;
-
-			pdev = to_pci_dev(hcd->self.controller);
-			switch (pdev->vendor) {
-			case 0x17a0:		/* GENESYS */
-				/* GL880S: should be PORTS=2 */
-				temp |= (ehci->hcs_params & ~0xf);
-				ehci->hcs_params = temp;
-				break;
-			case PCI_VENDOR_ID_NVIDIA:
-				/* NF4: should be PCC=10 */
-				break;
-			}
+		switch (pdev->vendor) {
+		case 0x17a0:		/* GENESYS */
+			/* GL880S: should be PORTS=2 */
+			temp |= (ehci->hcs_params & ~0xf);
+			ehci->hcs_params = temp;
+			break;
+		case PCI_VENDOR_ID_NVIDIA:
+			/* NF4: should be PCC=10 */
+			break;
 		}
 	}
 
 	/* force HC to halt state */
-	return ehci_halt (ehci);
+	return ehci_halt(ehci);
 }
 
-static int ehci_pci_start (struct usb_hcd *hcd)
+static int ehci_pci_start(struct usb_hcd *hcd)
 {
-	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
-	int result = 0;
-
-	if (hcd->self.controller->bus == &pci_bus_type) {
-		struct pci_dev		*pdev;
-		u16			port_wake;
-
-		pdev = to_pci_dev(hcd->self.controller);
-
-		/* Serial Bus Release Number is at PCI 0x60 offset */
-		pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
-
-		/* port wake capability, reported by boot firmware */
-		pci_read_config_word(pdev, 0x62, &port_wake);
-		hcd->can_wakeup = (port_wake & 1) != 0;
-
-		/* help hc dma work well with cachelines */
-		result = pci_set_mwi(pdev);
-		if (result)
-			ehci_dbg(ehci, "unable to enable MWI - not fatal.\n");
-	}
+	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
+	int			result = 0;
+	struct pci_dev		*pdev;
+	u16			port_wake;
+
+	pdev = to_pci_dev(hcd->self.controller);
+
+	/* Serial Bus Release Number is at PCI 0x60 offset */
+	pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
+
+	/* port wake capability, reported by boot firmware */
+	pci_read_config_word(pdev, 0x62, &port_wake);
+	hcd->can_wakeup = (port_wake & 1) != 0;
+
+	/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
+	result = pci_set_mwi(pdev);
+	if (!result)
+		ehci_dbg(ehci, "MWI active\n");
 
-	return ehci_run (hcd);
+	return ehci_run(hcd);
 }
 
 /* always called by thread; normally rmmod */
 
-static void ehci_pci_stop (struct usb_hcd *hcd)
+static void ehci_pci_stop(struct usb_hcd *hcd)
 {
-	ehci_stop (hcd);
+	ehci_stop(hcd);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -242,12 +232,12 @@ static void ehci_pci_stop (struct usb_hc
  * Also they depend on separate root hub suspend/resume.
  */
 
-static int ehci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
+static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
 {
-	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
 
-	if (time_before (jiffies, ehci->next_statechange))
-		msleep (10);
+	if (time_before(jiffies, ehci->next_statechange))
+		msleep(10);
 
 	// could save FLADJ in case of Vaux power loss
 	// ... we'd only use it to handle clock skew
@@ -255,30 +245,30 @@ static int ehci_pci_suspend (struct usb_
 	return 0;
 }
 
-static int ehci_pci_resume (struct usb_hcd *hcd)
+static int ehci_pci_resume(struct usb_hcd *hcd)
 {
-	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
 	unsigned		port;
 	struct usb_device	*root = hcd->self.root_hub;
 	int			retval = -EINVAL;
 
 	// maybe restore FLADJ
 
-	if (time_before (jiffies, ehci->next_statechange))
-		msleep (100);
+	if (time_before(jiffies, ehci->next_statechange))
+		msleep(100);
 
 	/* If CF is clear, we lost PCI Vaux power and need to restart.  */
-	if (readl (&ehci->regs->configured_flag) != cpu_to_le32(FLAG_CF))
+	if (readl(&ehci->regs->configured_flag) != cpu_to_le32(FLAG_CF))
 		goto restart;
 
 	/* If any port is suspended (or owned by the companion),
 	 * we know we can/must resume the HC (and mustn't reset it).
 	 * We just defer that to the root hub code.
 	 */
-	for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) {
+	for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
 		u32	status;
 		port--;
-		status = readl (&ehci->regs->port_status [port]);
+		status = readl(&ehci->regs->port_status [port]);
 		if (!(status & PORT_POWER))
 			continue;
 		if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {
@@ -289,35 +279,35 @@ static int ehci_pci_resume (struct usb_h
 
 restart:
 	ehci_dbg(ehci, "lost power, restarting\n");
-	for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) {
+	for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
 		port--;
 		if (!root->children [port])
 			continue;
-		usb_set_device_state (root->children[port],
+		usb_set_device_state(root->children[port],
 					USB_STATE_NOTATTACHED);
 	}
 
 	/* Else reset, to cope with power loss or flush-to-storage
 	 * style "resume" having let BIOS kick in during reboot.
 	 */
-	(void) ehci_halt (ehci);
-	(void) ehci_reset (ehci);
-	(void) ehci_pci_reset (hcd);
+	(void) ehci_halt(ehci);
+	(void) ehci_reset(ehci);
+	(void) ehci_pci_reset(hcd);
 
 	/* emptying the schedule aborts any urbs */
-	spin_lock_irq (&ehci->lock);
+	spin_lock_irq(&ehci->lock);
 	if (ehci->reclaim)
 		ehci->reclaim_ready = 1;
-	ehci_work (ehci, NULL);
-	spin_unlock_irq (&ehci->lock);
+	ehci_work(ehci, NULL);
+	spin_unlock_irq(&ehci->lock);
 
 	/* restart; khubd will disconnect devices */
-	retval = ehci_run (hcd);
+	retval = ehci_run(hcd);
 
 	/* here we "know" root ports should always stay powered;
 	 * but some controllers may lose all power.
 	 */
-	ehci_port_power (ehci, 1);
+	ehci_port_power(ehci, 1);
 
 	return retval;
 }
@@ -376,7 +366,7 @@ static const struct pci_device_id pci_id
 	},
 	{ /* end: all zeroes */ }
 };
-MODULE_DEVICE_TABLE (pci, pci_ids);
+MODULE_DEVICE_TABLE(pci, pci_ids);
 
 /* pci driver glue; this is a "new style" PCI driver module */
 static struct pci_driver ehci_pci_driver = {
@@ -392,22 +382,22 @@ static struct pci_driver ehci_pci_driver
 #endif
 };
 
-static int __init ehci_hcd_pci_init (void)
+static int __init ehci_hcd_pci_init(void)
 {
 	if (usb_disabled())
 		return -ENODEV;
 
-	pr_debug ("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
+	pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
 		hcd_name,
-		sizeof (struct ehci_qh), sizeof (struct ehci_qtd),
-		sizeof (struct ehci_itd), sizeof (struct ehci_sitd));
+		sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
+		sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
 
-	return pci_register_driver (&ehci_pci_driver);
+	return pci_register_driver(&ehci_pci_driver);
 }
-module_init (ehci_hcd_pci_init);
+module_init(ehci_hcd_pci_init);
 
-static void __exit ehci_hcd_pci_cleanup (void)
+static void __exit ehci_hcd_pci_cleanup(void)
 {
-	pci_unregister_driver (&ehci_pci_driver);
+	pci_unregister_driver(&ehci_pci_driver);
 }
-module_exit (ehci_hcd_pci_cleanup);
+module_exit(ehci_hcd_pci_cleanup);

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 18/22] USB: EHCI updates split init/reinit logic for resume
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (16 preceding siblings ...)
  2005-11-23 23:45   ` [patch 17/22] USB: EHCI updates mostly whitespace cleanups Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 19/22] USB: ohci, move ppc asic tweaks nearer pci Greg Kroah-Hartman
                     ` (4 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, david-b

[-- Attachment #1: usb-ehci-updates-split-init-reinit-logic-for-resume.patch --]
[-- Type: text/plain, Size: 15966 bytes --]

From: David Brownell <david-b@pacbell.net>


Moving the PCI-specific parts of the EHCI driver into their own file
created a few issues ... notably on resume paths which (like swsusp)
require re-initializing the controller.  This patch:

 - Splits the EHCI startup code into run-once HCD setup code and
   separate "init the hardware" reinit code.  (That reinit code is
   a superset of the "early usb handoff" code.)

 - Then it makes the PCI init code run both, and the resume code only
   run the reinit code.

 - It also removes needless pci wrappers around EHCI start/stop methods.

 - Removes a byteswap issue that would be seen on big-endian hardware.

The HCD glue still doesn't actually provide a good way to do all this
run-one init stuff in one place though.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-hcd.c |  155 +++++++++++++++++++++--------------------
 drivers/usb/host/ehci-pci.c |  166 ++++++++++++++++++++------------------------
 2 files changed, 161 insertions(+), 160 deletions(-)

--- usb-2.6.orig/drivers/usb/host/ehci-hcd.c
+++ usb-2.6/drivers/usb/host/ehci-hcd.c
@@ -411,50 +411,39 @@ static void ehci_stop (struct usb_hcd *h
 	dbg_status (ehci, "ehci_stop completed", readl (&ehci->regs->status));
 }
 
-static int ehci_run (struct usb_hcd *hcd)
+/* one-time init, only for memory state */
+static int ehci_init(struct usb_hcd *hcd)
 {
-	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
 	u32			temp;
 	int			retval;
 	u32			hcc_params;
-	int			first;
 
-	/* skip some things on restart paths */
-	first = (ehci->watchdog.data == 0);
-	if (first) {
-		init_timer (&ehci->watchdog);
-		ehci->watchdog.function = ehci_watchdog;
-		ehci->watchdog.data = (unsigned long) ehci;
-	}
+	spin_lock_init(&ehci->lock);
+
+	init_timer(&ehci->watchdog);
+	ehci->watchdog.function = ehci_watchdog;
+	ehci->watchdog.data = (unsigned long) ehci;
 
 	/*
 	 * hw default: 1K periodic list heads, one per frame.
 	 * periodic_size can shrink by USBCMD update if hcc_params allows.
 	 */
 	ehci->periodic_size = DEFAULT_I_TDPS;
-	if (first && (retval = ehci_mem_init (ehci, GFP_KERNEL)) < 0)
+	if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
 		return retval;
 
 	/* controllers may cache some of the periodic schedule ... */
-	hcc_params = readl (&ehci->caps->hcc_params);
-	if (HCC_ISOC_CACHE (hcc_params)) 	// full frame cache
+	hcc_params = readl(&ehci->caps->hcc_params);
+	if (HCC_ISOC_CACHE(hcc_params)) 	// full frame cache
 		ehci->i_thresh = 8;
 	else					// N microframes cached
-		ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params);
+		ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
 
 	ehci->reclaim = NULL;
 	ehci->reclaim_ready = 0;
 	ehci->next_uframe = -1;
 
-	/* controller state:  unknown --> reset */
-
-	/* EHCI spec section 4.1 */
-	if ((retval = ehci_reset (ehci)) != 0) {
-		ehci_mem_cleanup (ehci);
-		return retval;
-	}
-	writel (ehci->periodic_dma, &ehci->regs->frame_list);
-
 	/*
 	 * dedicate a qh for the async ring head, since we couldn't unlink
 	 * a 'real' qh without stopping the async schedule [4.8].  use it
@@ -462,37 +451,13 @@ static int ehci_run (struct usb_hcd *hcd
 	 * its dummy is used in hw_alt_next of many tds, to prevent the qh
 	 * from automatically advancing to the next td after short reads.
 	 */
-	if (first) {
-		ehci->async->qh_next.qh = NULL;
-		ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma);
-		ehci->async->hw_info1 = cpu_to_le32 (QH_HEAD);
-		ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT);
-		ehci->async->hw_qtd_next = EHCI_LIST_END;
-		ehci->async->qh_state = QH_STATE_LINKED;
-		ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma);
-	}
-	writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);
-
-	/*
-	 * hcc_params controls whether ehci->regs->segment must (!!!)
-	 * be used; it constrains QH/ITD/SITD and QTD locations.
-	 * pci_pool consistent memory always uses segment zero.
-	 * streaming mappings for I/O buffers, like pci_map_single(),
-	 * can return segments above 4GB, if the device allows.
-	 *
-	 * NOTE:  the dma mask is visible through dma_supported(), so
-	 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
-	 * Scsi_Host.highmem_io, and so forth.  It's readonly to all
-	 * host side drivers though.
-	 */
-	if (HCC_64BIT_ADDR (hcc_params)) {
-		writel (0, &ehci->regs->segment);
-#if 0
-// this is deeply broken on almost all architectures
-		if (!dma_set_mask (hcd->self.controller, DMA_64BIT_MASK))
-			ehci_info (ehci, "enabled 64bit DMA\n");
-#endif
-	}
+	ehci->async->qh_next.qh = NULL;
+	ehci->async->hw_next = QH_NEXT(ehci->async->qh_dma);
+	ehci->async->hw_info1 = cpu_to_le32(QH_HEAD);
+	ehci->async->hw_token = cpu_to_le32(QTD_STS_HALT);
+	ehci->async->hw_qtd_next = EHCI_LIST_END;
+	ehci->async->qh_state = QH_STATE_LINKED;
+	ehci->async->hw_alt_next = QTD_NEXT(ehci->async->dummy->qtd_dma);
 
 	/* clear interrupt enables, set irq latency */
 	if (log2_irq_thresh < 0 || log2_irq_thresh > 6)
@@ -507,13 +472,13 @@ static int ehci_run (struct usb_hcd *hcd
 		 * make problems:  throughput reduction (!), data errors...
 		 */
 		if (park) {
-			park = min (park, (unsigned) 3);
+			park = min(park, (unsigned) 3);
 			temp |= CMD_PARK;
 			temp |= park << 8;
 		}
-		ehci_info (ehci, "park %d\n", park);
+		ehci_dbg(ehci, "park %d\n", park);
 	}
-	if (HCC_PGM_FRAMELISTLEN (hcc_params)) {
+	if (HCC_PGM_FRAMELISTLEN(hcc_params)) {
 		/* periodic schedule size can be smaller than default */
 		temp &= ~(3 << 2);
 		temp |= (EHCI_TUNE_FLS << 2);
@@ -521,16 +486,63 @@ static int ehci_run (struct usb_hcd *hcd
 		case 0: ehci->periodic_size = 1024; break;
 		case 1: ehci->periodic_size = 512; break;
 		case 2: ehci->periodic_size = 256; break;
-		default:	BUG ();
+		default:	BUG();
 		}
 	}
+	ehci->command = temp;
+
+	ehci->reboot_notifier.notifier_call = ehci_reboot;
+	register_reboot_notifier(&ehci->reboot_notifier);
+
+	return 0;
+}
+
+/* start HC running; it's halted, ehci_init() has been run (once) */
+static int ehci_run (struct usb_hcd *hcd)
+{
+	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	int			retval;
+	u32			temp;
+	u32			hcc_params;
+
+	/* EHCI spec section 4.1 */
+	if ((retval = ehci_reset(ehci)) != 0) {
+		unregister_reboot_notifier(&ehci->reboot_notifier);
+		ehci_mem_cleanup(ehci);
+		return retval;
+	}
+	writel(ehci->periodic_dma, &ehci->regs->frame_list);
+	writel((u32)ehci->async->qh_dma, &ehci->regs->async_next);
+
+	/*
+	 * hcc_params controls whether ehci->regs->segment must (!!!)
+	 * be used; it constrains QH/ITD/SITD and QTD locations.
+	 * pci_pool consistent memory always uses segment zero.
+	 * streaming mappings for I/O buffers, like pci_map_single(),
+	 * can return segments above 4GB, if the device allows.
+	 *
+	 * NOTE:  the dma mask is visible through dma_supported(), so
+	 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
+	 * Scsi_Host.highmem_io, and so forth.  It's readonly to all
+	 * host side drivers though.
+	 */
+	hcc_params = readl(&ehci->caps->hcc_params);
+	if (HCC_64BIT_ADDR(hcc_params)) {
+		writel(0, &ehci->regs->segment);
+#if 0
+// this is deeply broken on almost all architectures
+		if (!dma_set_mask(hcd->self.controller, DMA_64BIT_MASK))
+			ehci_info(ehci, "enabled 64bit DMA\n");
+#endif
+	}
+
+
 	// Philips, Intel, and maybe others need CMD_RUN before the
 	// root hub will detect new devices (why?); NEC doesn't
-	temp |= CMD_RUN;
-	writel (temp, &ehci->regs->command);
-	dbg_cmd (ehci, "init", temp);
-
-	/* set async sleep time = 10 us ... ? */
+	ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
+	ehci->command |= CMD_RUN;
+	writel (ehci->command, &ehci->regs->command);
+	dbg_cmd (ehci, "init", ehci->command);
 
 	/*
 	 * Start, enabling full USB 2.0 functionality ... usb 1.1 devices
@@ -538,26 +550,23 @@ static int ehci_run (struct usb_hcd *hcd
 	 * involved with the root hub.  (Except where one is integrated,
 	 * and there's no companion controller unless maybe for USB OTG.)
 	 */
-	if (first) {
-		ehci->reboot_notifier.notifier_call = ehci_reboot;
-		register_reboot_notifier (&ehci->reboot_notifier);
-	}
-
 	hcd->state = HC_STATE_RUNNING;
 	writel (FLAG_CF, &ehci->regs->configured_flag);
-	readl (&ehci->regs->command);	/* unblock posted write */
+	readl (&ehci->regs->command);	/* unblock posted writes */
 
 	temp = HC_VERSION(readl (&ehci->caps->hc_capbase));
 	ehci_info (ehci,
-		"USB %x.%x %s, EHCI %x.%02x, driver %s\n",
+		"USB %x.%x started, EHCI %x.%02x, driver %s\n",
 		((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
-		first ? "initialized" : "restarted",
 		temp >> 8, temp & 0xff, DRIVER_VERSION);
 
 	writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */
 
-	if (first)
-		create_debug_files (ehci);
+	/* GRR this is run-once init(), being done every time the HC starts.
+	 * So long as they're part of class devices, we can't do it init()
+	 * since the class device isn't created that early.
+	 */
+	create_debug_files(ehci);
 
 	return 0;
 }
--- usb-2.6.orig/drivers/usb/host/ehci-pci.c
+++ usb-2.6/drivers/usb/host/ehci-pci.c
@@ -58,15 +58,76 @@ static int bios_handoff(struct ehci_hcd 
 	return 0;
 }
 
-/* called by khubd or root hub init threads */
+/* called after powerup, by probe or system-pm "wakeup" */
+static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
+{
+	u32			temp;
+	int			retval;
+	unsigned		count = 256/4;
+
+	/* optional debug port, normally in the first BAR */
+	temp = pci_find_capability(pdev, 0x0a);
+	if (temp) {
+		pci_read_config_dword(pdev, temp, &temp);
+		temp >>= 16;
+		if ((temp & (3 << 13)) == (1 << 13)) {
+			temp &= 0x1fff;
+			ehci->debug = ehci_to_hcd(ehci)->regs + temp;
+			temp = readl(&ehci->debug->control);
+			ehci_info(ehci, "debug port %d%s\n",
+				HCS_DEBUG_PORT(ehci->hcs_params),
+				(temp & DBGP_ENABLED)
+					? " IN USE"
+					: "");
+			if (!(temp & DBGP_ENABLED))
+				ehci->debug = NULL;
+		}
+	}
+
+	temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params));
+
+	/* EHCI 0.96 and later may have "extended capabilities" */
+	while (temp && count--) {
+		u32		cap;
+
+		pci_read_config_dword(pdev, temp, &cap);
+		ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp);
+		switch (cap & 0xff) {
+		case 1:			/* BIOS/SMM/... handoff */
+			if (bios_handoff(ehci, temp, cap) != 0)
+				return -EOPNOTSUPP;
+			break;
+		case 0:			/* illegal reserved capability */
+			ehci_dbg(ehci, "illegal capability!\n");
+			cap = 0;
+			/* FALLTHROUGH */
+		default:		/* unknown */
+			break;
+		}
+		temp = (cap >> 8) & 0xff;
+	}
+	if (!count) {
+		ehci_err(ehci, "bogus capabilities ... PCI problems!\n");
+		return -EIO;
+	}
+
+	/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
+	retval = pci_set_mwi(pdev);
+	if (!retval)
+		ehci_dbg(ehci, "MWI active\n");
+
+	ehci_port_power(ehci, 0);
+
+	return 0;
+}
+
+/* called by khubd or root hub (re)init threads; leaves HC in halt state */
 static int ehci_pci_reset(struct usb_hcd *hcd)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
 	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
 	u32			temp;
-	unsigned		count = 256/4;
-
-	spin_lock_init (&ehci->lock);
+	int			retval;
 
 	ehci->caps = hcd->regs;
 	ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));
@@ -76,6 +137,10 @@ static int ehci_pci_reset(struct usb_hcd
 	/* cache this readonly data; minimize chip reads */
 	ehci->hcs_params = readl(&ehci->caps->hcs_params);
 
+	retval = ehci_halt(ehci);
+	if (retval)
+		return retval;
+
 	/* NOTE:  only the parts below this line are PCI-specific */
 
 	switch (pdev->vendor) {
@@ -111,57 +176,9 @@ static int ehci_pci_reset(struct usb_hcd
 		break;
 	}
 
-	/* optional debug port, normally in the first BAR */
-	temp = pci_find_capability(pdev, 0x0a);
-	if (temp) {
-		pci_read_config_dword(pdev, temp, &temp);
-		temp >>= 16;
-		if ((temp & (3 << 13)) == (1 << 13)) {
-			temp &= 0x1fff;
-			ehci->debug = hcd->regs + temp;
-			temp = readl(&ehci->debug->control);
-			ehci_info(ehci, "debug port %d%s\n",
-				HCS_DEBUG_PORT(ehci->hcs_params),
-				(temp & DBGP_ENABLED)
-					? " IN USE"
-					: "");
-			if (!(temp & DBGP_ENABLED))
-				ehci->debug = NULL;
-		}
-	}
-
-	temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params));
-
-	/* EHCI 0.96 and later may have "extended capabilities" */
-	while (temp && count--) {
-		u32		cap;
-
-		pci_read_config_dword(to_pci_dev(hcd->self.controller),
-				temp, &cap);
-		ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp);
-		switch (cap & 0xff) {
-		case 1:			/* BIOS/SMM/... handoff */
-			if (bios_handoff(ehci, temp, cap) != 0)
-				return -EOPNOTSUPP;
-			break;
-		case 0:			/* illegal reserved capability */
-			ehci_warn(ehci, "illegal capability!\n");
-			cap = 0;
-			/* FALLTHROUGH */
-		default:		/* unknown */
-			break;
-		}
-		temp = (cap >> 8) & 0xff;
-	}
-	if (!count) {
-		ehci_err(ehci, "bogus capabilities ... PCI problems!\n");
-		return -EIO;
-	}
 	if (ehci_is_TDI(ehci))
 		ehci_reset(ehci);
 
-	ehci_port_power(ehci, 0);
-
 	/* at least the Genesys GL880S needs fixup here */
 	temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
 	temp &= 0x0f;
@@ -184,39 +201,15 @@ static int ehci_pci_reset(struct usb_hcd
 		}
 	}
 
-	/* force HC to halt state */
-	return ehci_halt(ehci);
-}
-
-static int ehci_pci_start(struct usb_hcd *hcd)
-{
-	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
-	int			result = 0;
-	struct pci_dev		*pdev;
-	u16			port_wake;
-
-	pdev = to_pci_dev(hcd->self.controller);
-
 	/* Serial Bus Release Number is at PCI 0x60 offset */
 	pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
 
-	/* port wake capability, reported by boot firmware */
-	pci_read_config_word(pdev, 0x62, &port_wake);
-	hcd->can_wakeup = (port_wake & 1) != 0;
-
-	/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
-	result = pci_set_mwi(pdev);
-	if (!result)
-		ehci_dbg(ehci, "MWI active\n");
-
-	return ehci_run(hcd);
-}
+	/* REVISIT:  per-port wake capability (PCI 0x62) currently unused */
 
-/* always called by thread; normally rmmod */
+	retval = ehci_pci_reinit(ehci, pdev);
 
-static void ehci_pci_stop(struct usb_hcd *hcd)
-{
-	ehci_stop(hcd);
+	/* finish init */
+	return ehci_init(hcd);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -250,6 +243,7 @@ static int ehci_pci_resume(struct usb_hc
 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
 	unsigned		port;
 	struct usb_device	*root = hcd->self.root_hub;
+	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
 	int			retval = -EINVAL;
 
 	// maybe restore FLADJ
@@ -258,7 +252,7 @@ static int ehci_pci_resume(struct usb_hc
 		msleep(100);
 
 	/* If CF is clear, we lost PCI Vaux power and need to restart.  */
-	if (readl(&ehci->regs->configured_flag) != cpu_to_le32(FLAG_CF))
+	if (readl(&ehci->regs->configured_flag) != FLAG_CF)
 		goto restart;
 
 	/* If any port is suspended (or owned by the companion),
@@ -292,7 +286,7 @@ restart:
 	 */
 	(void) ehci_halt(ehci);
 	(void) ehci_reset(ehci);
-	(void) ehci_pci_reset(hcd);
+	(void) ehci_pci_reinit(ehci, pdev);
 
 	/* emptying the schedule aborts any urbs */
 	spin_lock_irq(&ehci->lock);
@@ -304,9 +298,7 @@ restart:
 	/* restart; khubd will disconnect devices */
 	retval = ehci_run(hcd);
 
-	/* here we "know" root ports should always stay powered;
-	 * but some controllers may lose all power.
-	 */
+	/* here we "know" root ports should always stay powered */
 	ehci_port_power(ehci, 1);
 
 	return retval;
@@ -328,12 +320,12 @@ static const struct hc_driver ehci_pci_h
 	 * basic lifecycle operations
 	 */
 	.reset =		ehci_pci_reset,
-	.start =		ehci_pci_start,
+	.start =		ehci_run,
 #ifdef	CONFIG_PM
 	.suspend =		ehci_pci_suspend,
 	.resume =		ehci_pci_resume,
 #endif
-	.stop =			ehci_pci_stop,
+	.stop =			ehci_stop,
 
 	/*
 	 * managing i/o requests and associated device resources

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 19/22] USB: ohci, move ppc asic tweaks nearer pci
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (17 preceding siblings ...)
  2005-11-23 23:45   ` [patch 18/22] USB: EHCI updates split init/reinit logic for resume Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 20/22] USB: fix USB key generates ioctl_internal_command errors issue Greg Kroah-Hartman
                     ` (3 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, david-b

[-- Attachment #1: usb-ohci-move-ppc-asic-tweaks-nearer-pci.patch --]
[-- Type: text/plain, Size: 3809 bytes --]

From: David Brownell <david-b@pacbell.net>

This should fix a suspend/resume issues that appear with OHCI on some
PPC hardware.  The PCI layer should doesn't have the hooks needed for
such ASIC-specific hooks (in this case, software clock gating), so
this moves the code to do that into hcd-pci.c ... where it can be
done after the relevant PCI PM state transition (to/from D3).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/hcd-pci.c  |   38 ++++++++++++++++++++++++++++++++++++--
 drivers/usb/host/ohci-pci.c |   36 ------------------------------------
 2 files changed, 36 insertions(+), 38 deletions(-)

--- usb-2.6.orig/drivers/usb/core/hcd-pci.c
+++ usb-2.6/drivers/usb/core/hcd-pci.c
@@ -20,9 +20,17 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/usb.h>
+
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <linux/usb.h>
+
+#ifdef CONFIG_PPC_PMAC
+#include <asm/machdep.h>
+#include <asm/pmac_feature.h>
+#include <asm/pci-bridge.h>
+#include <asm/prom.h>
+#endif
 
 #include "usb.h"
 #include "hcd.h"
@@ -277,8 +285,22 @@ int usb_hcd_pci_suspend (struct pci_dev 
 	}
 
 done:
-	if (retval == 0)
+	if (retval == 0) {
 		dev->dev.power.power_state = PMSG_SUSPEND;
+
+#ifdef CONFIG_PPC_PMAC
+		/* Disable ASIC clocks for USB */
+		if (_machine == _MACH_Pmac) {
+			struct device_node	*of_node;
+
+			of_node = pci_device_to_OF_node (dev);
+			if (of_node)
+				pmac_call_feature(PMAC_FTR_USB_ENABLE,
+							of_node, 0, 0);
+		}
+#endif
+	}
+
 	return retval;
 }
 EXPORT_SYMBOL (usb_hcd_pci_suspend);
@@ -301,6 +323,18 @@ int usb_hcd_pci_resume (struct pci_dev *
 		return 0;
 	}
 
+#ifdef CONFIG_PPC_PMAC
+	/* Reenable ASIC clocks for USB */
+	if (_machine == _MACH_Pmac) {
+		struct device_node *of_node;
+
+		of_node = pci_device_to_OF_node (dev);
+		if (of_node)
+			pmac_call_feature (PMAC_FTR_USB_ENABLE,
+						of_node, 0, 1);
+	}
+#endif
+
 	/* NOTE:  chip docs cover clean "real suspend" cases (what Linux
 	 * calls "standby", "suspend to RAM", and so on).  There are also
 	 * dirty cases when swsusp fakes a suspend in "shutdown" mode.
--- usb-2.6.orig/drivers/usb/host/ohci-pci.c
+++ usb-2.6/drivers/usb/host/ohci-pci.c
@@ -14,15 +14,6 @@
  * This file is licenced under the GPL.
  */
  
-#include <linux/jiffies.h>
-
-#ifdef CONFIG_PPC_PMAC
-#include <asm/machdep.h>
-#include <asm/pmac_feature.h>
-#include <asm/pci-bridge.h>
-#include <asm/prom.h>
-#endif
-
 #ifndef CONFIG_PCI
 #error "This file is PCI bus glue.  CONFIG_PCI must be defined."
 #endif
@@ -115,39 +106,12 @@ ohci_pci_start (struct usb_hcd *hcd)
 static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
 {
 	/* root hub was already suspended */
-
-	/* FIXME these PMAC things get called in the wrong places.  ASIC
-	 * clocks should be turned off AFTER entering D3, and on BEFORE
-	 * trying to enter D0.  Evidently the PCI layer doesn't currently
-	 * provide the right sort of platform hooks for this ...
-	 */
-#ifdef CONFIG_PPC_PMAC
-	if (_machine == _MACH_Pmac) {
-	   	struct device_node	*of_node;
- 
-		/* Disable USB PAD & cell clock */
-		of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));
-		if (of_node)
-			pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0);
-	}
-#endif /* CONFIG_PPC_PMAC */
 	return 0;
 }
 
 
 static int ohci_pci_resume (struct usb_hcd *hcd)
 {
-#ifdef CONFIG_PPC_PMAC
-	if (_machine == _MACH_Pmac) {
-		struct device_node *of_node;
-
-		/* Re-enable USB PAD & cell clock */
-		of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));
-		if (of_node)
-			pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);
-	}
-#endif /* CONFIG_PPC_PMAC */
-
 	usb_hcd_resume_root_hub(hcd);
 	return 0;
 }

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 20/22] USB: fix USB key generates ioctl_internal_command errors issue
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (18 preceding siblings ...)
  2005-11-23 23:45   ` [patch 19/22] USB: ohci, move ppc asic tweaks nearer pci Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 21/22] USB: kernel-doc for linux/usb.h Greg Kroah-Hartman
                     ` (2 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, david

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: usb-fix-usb-key-generates-ioctl_internal_command-errors-issue.patch --]
[-- Type: text/plain; charset=unknown-8bit, Size: 1800 bytes --]

From: David Härdeman <david@2gen.com>

On Wed, Nov 16, 2005 at 06:34:24PM -0800, Pete Zaitcev wrote:
>On Wed, 16 Nov 2005 23:52:32 +0100, David Härdeman <david@2gen.com> wrote:
>> usb-storage: waiting for device to settle before scanning
>>   Vendor: I0MEGA    Model: UMni1GB*IOM2K4    Rev: 1.01
>>   Type:   Direct-Access                      ANSI SCSI revision: 02
>> SCSI device sda: 2048000 512-byte hdwr sectors (1049 MB)
>> sda: Write Protect is off
>> sda: Mode Sense: 00 00 00 00
>> sda: assuming drive cache: write through
>> ioctl_internal_command: <8 0 0 0> return code = 8000002
>>    : Current: sense key=0x0
>>     ASC=0x0 ASCQ=0x0
>> SCSI device sda: 2048000 512-byte hdwr sectors (1049 MB)
>
>I think it's harmless. I saw things like that, and initially I plugged
>them with workarounds like this:

Thanks for the pointer, and yes, it is harmless, but it floods the
console with the messages which hides other (potentially important)
messages...following your example I've made a patch which fixes the
problem.

Signed-off-by: David Härdeman <david@2gen.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/storage/unusual_devs.h |    9 +++++++++
 1 file changed, 9 insertions(+)

--- usb-2.6.orig/drivers/usb/storage/unusual_devs.h
+++ usb-2.6/drivers/usb/storage/unusual_devs.h
@@ -1118,6 +1118,15 @@ UNUSUAL_DEV(  0x2735, 0x100b, 0x0000, 0x
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_GO_SLOW ),
 
+/*
+ * David Härdeman <david@2gen.com>
+ * The key makes the SCSI stack print confusing (but harmless) messages
+ */
+UNUSUAL_DEV(  0x4146, 0xba01, 0x0100, 0x0100,
+		"Iomega",
+		"Micro Mini 1GB",
+		US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ),
+
 #ifdef CONFIG_USB_STORAGE_SDDR55
 UNUSUAL_DEV(  0x55aa, 0xa103, 0x0000, 0x9999, 
 		"Sandisk",

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 21/22] USB: kernel-doc for linux/usb.h
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (19 preceding siblings ...)
  2005-11-23 23:45   ` [patch 20/22] USB: fix USB key generates ioctl_internal_command errors issue Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-23 23:45   ` [patch 22/22] usb serial: remove redundant include Greg Kroah-Hartman
  2005-11-24  0:01   ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Linus Torvalds
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, rdunlap

[-- Attachment #1: usb-kernel-doc-for-linux-usb.h.patch --]
[-- Type: text/plain, Size: 717 bytes --]

From: Randy Dunlap <rdunlap@xenotime.net>

Fix kernel-doc warning in linux/usb.h.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/usb.h |    1 +
 1 file changed, 1 insertion(+)

--- usb-2.6.orig/include/linux/usb.h
+++ usb-2.6/include/linux/usb.h
@@ -47,6 +47,7 @@ struct usb_driver;
  * @urb_list: urbs queued to this endpoint; maintained by usbcore
  * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
  *	with one or more transfer descriptors (TDs) per urb
+ * @kobj: kobject for sysfs info
  * @extra: descriptors following this endpoint in the configuration
  * @extralen: how many bytes of "extra" are valid
  *

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch 22/22] usb serial: remove redundant include
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (20 preceding siblings ...)
  2005-11-23 23:45   ` [patch 21/22] USB: kernel-doc for linux/usb.h Greg Kroah-Hartman
@ 2005-11-23 23:45   ` Greg Kroah-Hartman
  2005-11-24  0:01   ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Linus Torvalds
  22 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-usb-devel, nikai

[-- Attachment #1: usb-serial-remove-redundant-include.patch --]
[-- Type: text/plain, Size: 495 bytes --]

From: Nicolas Kaiser <nikai@nikai.net>

remove redundant include

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/ipw.c |    1 -
 1 file changed, 1 deletion(-)

--- usb-2.6.orig/drivers/usb/serial/ipw.c
+++ usb-2.6/drivers/usb/serial/ipw.c
@@ -46,7 +46,6 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/usb.h>
-#include <linux/usb.h>
 #include <asm/uaccess.h>
 #include "usb-serial.h"
 

--

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git
  2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
                     ` (21 preceding siblings ...)
  2005-11-23 23:45   ` [patch 22/22] usb serial: remove redundant include Greg Kroah-Hartman
@ 2005-11-24  0:01   ` Linus Torvalds
  2005-11-24  0:57     ` Greg KH
  22 siblings, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2005-11-24  0:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Andrew Morton, linux-kernel, linux-usb-devel



On Wed, 23 Nov 2005, Greg Kroah-Hartman wrote:
>
> Here are a few PCI, USB, hwmon, and documentation patches against your
> latest git tree, they have all been in the past few -mm releases just
> fine.

Is there any reason you don't use git to sync up?

		Linus

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git
  2005-11-24  0:01   ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Linus Torvalds
@ 2005-11-24  0:57     ` Greg KH
  0 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2005-11-24  0:57 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Greg Kroah-Hartman, Andrew Morton, linux-kernel, linux-usb-devel

On Wed, Nov 23, 2005 at 04:01:36PM -0800, Linus Torvalds wrote:
> 
> 
> On Wed, 23 Nov 2005, Greg Kroah-Hartman wrote:
> >
> > Here are a few PCI, USB, hwmon, and documentation patches against your
> > latest git tree, they have all been in the past few -mm releases just
> > fine.
> 
> Is there any reason you don't use git to sync up?

I did use git to make sure these patches all applied cleanly to your
latest tree.

I wasn't using git to send stuff to you after -rc1, as it makes me make
extra sure the stuff is really needed.  Just a hold-over from when I
thought we weren't supposed to use git to send stuff to you after -rc1.

If it's easier for you, I can use git to send you these, and future
patches.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2005-11-24  0:58 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20051123225156.624397000@press.kroah.org>
2005-11-23 23:43 ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Greg Kroah-Hartman
2005-11-23 23:43   ` [patch 01/22] Small fixes to driver core Greg Kroah-Hartman
2005-11-23 23:43   ` [patch 02/22] MTD git tree location added to MAINTAINERS Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 03/22] Clarify T: field in MAINTAINERS Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 04/22] Add more SCM trees to MAINTAINERS Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 05/22] hwmon: Fix missing boundary check when setting W83627THF in0 limits Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 06/22] hwmon: Fix lm78 VID conversion Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 07/22] hwmon: Fix missing it87 fan div init Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 08/22] hwmon: hdaps missing an axis Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 09/22] PCI: trivial printk updates in common.c Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 10/22] PCI Express Hotplug: clear sticky power-fault bit Greg Kroah-Hartman
2005-11-23 23:44   ` [patch 11/22] PCI: remove bogus resource collision error Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 12/22] PCI: kernel-doc fix for pci-acpi.c Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 13/22] PCI: direct.c: DBG Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 14/22] USB: SN9C10x driver - bad page state fix Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 15/22] USB: ftdi_sio: new IDs for KOBIL devices Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 16/22] USB: EHCI updates Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 17/22] USB: EHCI updates mostly whitespace cleanups Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 18/22] USB: EHCI updates split init/reinit logic for resume Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 19/22] USB: ohci, move ppc asic tweaks nearer pci Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 20/22] USB: fix USB key generates ioctl_internal_command errors issue Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 21/22] USB: kernel-doc for linux/usb.h Greg Kroah-Hartman
2005-11-23 23:45   ` [patch 22/22] usb serial: remove redundant include Greg Kroah-Hartman
2005-11-24  0:01   ` [patch 00/22] PCI, USB and hwmon patches for 2.6.15-rc2-git Linus Torvalds
2005-11-24  0:57     ` Greg KH

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).