All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Winischhofer <tw@webit.com>
To: linux-kernel@vger.kernel.org, linux-usb-devel@lists.sourceforge.net
Subject: Re: USB-OHCI + USB broken in 2.4.14/15pre2?
Date: Sun, 18 Nov 2001 20:13:39 +0100	[thread overview]
Message-ID: <3BF80863.88128F58@webit.com> (raw)
In-Reply-To: <3BF7B50A.B1AC9FE@webit.com>



Thomas Winischhofer wrote:
> 
> Kiitos/tack; however, to make it actually work on my particular machine
> I needed to
> 
> 1) call hc_restart(ohci) in default section of switch statement AND
> 
> 2) like you said, insert "pci_enable_device(dev);" right after the
> declarations in ohci_pci_resume(). (I think this should be done after
> the check for concurrent resumes, anyway).

WRONG. This does as a matter of fact _not_ work:

When a device is connected to the bus at the time of suspend, using my
somewhat brutal method recovers that device at resume from suspend. So
far so good.

But: When there's _no_ device connected to the usb at the time of
suspend, the bus does NOT recover properly and produces errors after
resume whenever I try to connect a device.

Here's what I did:

----
--- /root/usb-ohci.c	Sun Nov 18 19:26:00 2001
+++ /usr/src/linux/drivers/usb/usb-ohci.c	Sun Nov 18 19:37:27 2001
@@ -2678,16 +2678,16 @@
 	mdelay (500); /* No schedule here ! */
 	switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) {
 		case OHCI_USB_RESET: /* dbg statt info!/TW */
-			dbg("Bus in reset phase ???");
+			info("Bus in reset phase ???");
 			break;
 		case OHCI_USB_RESUME:
-			dbg("Bus in resume phase ???");
+			info("Bus in resume phase ???");
 			break;
 		case OHCI_USB_OPER:
-			dbg("Bus in operational phase ???");
+			info("Bus in operational phase ???");
 			break;
 		case OHCI_USB_SUSPEND:
-			dbg("Bus suspended");
+			info("Bus suspended");
 			break;
 	}
 	/* In some rare situations, Apple's OHCI have happily trashed
@@ -2719,6 +2719,8 @@
 	int		temp;
 	unsigned long	flags;
 
+	pci_enable_device(dev);
+	
 	/* guard against multiple resumes */
 	atomic_inc (&ohci->resume_count);
 	if (atomic_read (&ohci->resume_count) != 1) {
@@ -2812,6 +2814,7 @@
 
 	default:
 		warn ("odd PCI resume for usb-%s", dev->slot_name);
+		hc_restart (ohci);
 	}
 
 	/* controller is operational, extra resumes are harmless */

----

The log:

---- suspending:
Nov 18 19:45:00 oland cardmgr[189]: executing: './network suspend eth1'
Nov 18 19:45:00 oland kernel: NETDEV WATCHDOG: eth1: transmit timed out
Nov 18 19:45:00 oland kernel: eth1: Transmit timeout.
Nov 18 19:45:00 oland kernel: usb-ohci.c: USB suspend: usb-00:01.2
Nov 18 19:45:01 oland kernel: usb-ohci.c: Bus suspended
Nov 18 19:45:01 oland kernel: usb-ohci.c: USB suspend: usb-00:01.3
Nov 18 19:45:01 oland kernel: usb-ohci.c: Bus suspended
Nov 18 19:45:06 oland apmd[350]: User Suspend
----

---- resuming:
Nov 18 19:45:13 oland kernel: PCI: Found IRQ 11 for device 00:01.2
Nov 18 19:45:13 oland kernel: PCI: Sharing IRQ 11 with 00:01.3
Nov 18 19:45:13 oland kernel: usb-ohci.c: odd PCI resume for usb-00:01.2
Nov 18 19:45:13 oland kernel: usb.c: USB disconnect on device 1
Nov 18 19:45:14 oland kernel: hub.c: USB hub found
Nov 18 19:45:14 oland kernel: hub.c: 3 ports detected
Nov 18 19:45:14 oland kernel: PCI: Found IRQ 11 for device 00:01.3
Nov 18 19:45:14 oland kernel: PCI: Sharing IRQ 11 with 00:01.2
Nov 18 19:45:14 oland kernel: usb-ohci.c: odd PCI resume for usb-00:01.3
Nov 18 19:45:14 oland kernel: usb.c: USB disconnect on device 1
Nov 18 19:45:14 oland kernel: hub.c: USB hub found
Nov 18 19:45:14 oland kernel: hub.c: 3 ports detected
Nov 18 19:45:14 oland kernel: APIC error on CPU0: 00(40)
Nov 18 19:45:15 oland cardmgr[189]: executing: './network resume eth1'
Nov 18 19:45:16 oland apmd[350]: Normal Resume after 00:00:10 (99%
unknown) AC power
Nov 18 19:45:17 oland apmd[350]: Normal Resume after 00:00:11 (99%
unknown) AC power
----

(Why resume twice?)

---- connecting device (mouse)
Nov 18 19:45:29 oland kernel: hub.c: USB new device connect on bus1/3,
assigned device number 3
Nov 18 19:45:32 oland kernel: usb_control/bulk_msg: timeout
Nov 18 19:45:32 oland kernel: usb.c: USB device not accepting new
address=3 (error=-110)
Nov 18 19:45:33 oland kernel: hub.c: USB new device connect on bus1/3,
assigned device number 4
Nov 18 19:45:36 oland kernel: usb_control/bulk_msg: timeout
Nov 18 19:45:36 oland kernel: usb.c: USB device not accepting new
address=4 (error=-110)
----

There we are again. What do the ohci gurus say?

Thomas

-- 
Thomas Winischhofer
Vienna/Austria                  Check it out:         
mailto:tw@webit.com              *** http://www.webit.com/tw

  reply	other threads:[~2001-11-18 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-18 13:18 USB-OHCI + USB broken in 2.4.14/15pre2? Thomas Winischhofer
2001-11-18 19:13 ` Thomas Winischhofer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-11-19 23:03 Thomas Winischhofer
2001-11-18  4:14 Thomas Winischhofer
2001-11-18  6:17 ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BF80863.88128F58@webit.com \
    --to=tw@webit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.