From owner-freebsd-mobile Sat Nov 18 17:55:37 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 22D6E37B479 for ; Sat, 18 Nov 2000 17:55:33 -0800 (PST) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.10.2+3.3W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id eAJ1tUq54533; Sun, 19 Nov 2000 10:55:30 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: n_hibma@qubesoft.com Cc: keichii@peorth.iteration.net, mobile@freebsd.org Subject: Re: usb0 not resuming and APM/ACPI weirdness In-Reply-To: References: <20001028051133.A409@peorth.iteration.net> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001119105525E.iwasaki@jp.FreeBSD.org> Date: Sun, 19 Nov 2000 10:55:25 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 131 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, > > The old "usb0: host controller halted" problem has returned > > to my laptop after resume for suspend-to-disk on the latest current > > for some time. After resume, usb0 floods my /var/log/messages > > with thousands of the same messages. > > This is most probably a problem related to ACPI, it suspending the USB > host controller when suspending and the USB driver getting it wrong when > unsuspending. I have no idea how to fix this. Yes, most of modern laptops has power management related methods on various devices (including USB host controller) in ACPI Machine Language format. And these methods should to be executed by AML interpreter in order to maintain (or re-initialize?) the devices when the machine is going to sleep/wakeup. I guess that the problem is - When suspend-to-{RAM|disk} by APM, any AML methods won't be executed. - Currently, our ACPI code supports limited sleep state only (suspend/hibernation in APM haven't supported yet). so I think that implement sleep/wakeup code in device driver which equivalent to AML methods would be a short-term solution... # acpidump(8) and amldb(8) maybe help us. Of course I know that ACPI support improvement is better solution. BTW Michael, what laptop are you using? and could you send me ACPI data? # please see acpidump(8) Following is a example of USB sleep/wakeup methods in disassembled AML format which is from Sony PCG-Z505SX. # _S3 is for sleep (suspending in APM), _S0 is for wakeup (resuming). Scope(_SB_) { : Device(PCI0) { : Device(USB0) { : Name(_PSC, 0x0) Method(_PS0) { If(LEqual(_PSC, 0x3)) { PHS_(0xf2) Store(0x0, _PSC) } } Method(_PS3) { If(LEqual(_PSC, 0x0)) { PHS_(0xf1) Store(0x3, _PSC) } } } : } : } : OperationRegion(SMI0, SystemMemory, 0x07fffdbc, 0x00000200) Field(SMI0, AnyAcc, NoLock, Preserve) { BCMD, 8, DID_, 32, INFO, 4000 } : Field(SMI0, AnyAcc, NoLock, Preserve) { Offset(0x5), INFD, 32 } OperationRegion(SMI1, SystemIO, 0x00008040, 0x00000002) Field(SMI1, AnyAcc, NoLock, Preserve) { SMIC, 8 } Mutex(MPHS, 0) Method(PHS0, 1) { Store(Arg0, BCMD) Store(Zero, SMIC) While(LEqual(BCMD, Arg0)) { } Store(0x0, BCMD) } Method(PHS_, 1, Serialized) { Acquire(MPHS, 0xffff) Store(0x0, DID_) PHS0(Arg0) Store(INFD, Local0) Release(MPHS) Return(Local0) } And runing amldb(8) give us a lot of hints to implement sleep/wakeup code. % amldb PCG-Z505SX-R0205Z0.dsdt Loading PCG-Z505SX-R0205Z0.dsdt...done AML>r \_SB_.PCI0.USB0._PS3 Method: Arg 0 From 0x28060c4b To 0x28060c61 ==== Running \_SB_.PCI0.USB0._PS3. ==== AML>s [\_SB_.PCI0.USB0._PS3. START] If(LEqual(_PSC, 0x0)){ PHS_(0xf1) AML> [\PHS_. START] Acquire(MPHS, 0xffff) AML> Store(0x0, DID_) [aml_region_write(0, 0, 0x0, 0x7fffdbc, 0x20, 0x20)] [0:0x0@0x7fffdc0:0,32] ->[0:0x0@0x7fffdc0:0,32] [write(0, 0x0, 0x7fffdc0)] [aml_region_read(0, 0, 0x7fffdbc, 0x20, 0x20)] [0:0x0@0x7fffdc0:0,32] DEBUG[read(0, 0x7fffdc0)&mask:0x0](default: 0x0 / 0) >> [read(0, 0x7fffdc0)->0x0] AML> PHS0(Arg0) AML> [\PHS0. START] Store(Arg0, BCMD) [aml_region_write(0, 0, 0xf1, 0x7fffdbc, 0x0, 0x8)] [0:0x0@0x7fffdbc:0,8] ->[0:0xf1@0x7fffdbc:0,8] [write(0, 0xf1, 0x7fffdbc)] [aml_region_read(0, 0, 0x7fffdbc, 0x0, 0x8)] [0:0xf1@0x7fffdbc:0,8] DEBUG[read(0, 0x7fffdbc)&mask:0xf1](default: 0xf1 / 241) >> : Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message