From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NGqlU-0007VB-0b for mharc-grub-devel@gnu.org; Sat, 05 Dec 2009 04:17:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGqlR-0007U5-O0 for grub-devel@gnu.org; Sat, 05 Dec 2009 04:17:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGqlN-0007Sj-2J for grub-devel@gnu.org; Sat, 05 Dec 2009 04:17:17 -0500 Received: from [199.232.76.173] (port=55060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGqlM-0007Sd-Oc for grub-devel@gnu.org; Sat, 05 Dec 2009 04:17:12 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:41748) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGqlM-0005uJ-8k for grub-devel@gnu.org; Sat, 05 Dec 2009 04:17:12 -0500 Received: by bwz7 with SMTP id 7so2733299bwz.26 for ; Sat, 05 Dec 2009 01:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=0CcD7jMQHDBIrjeLhfXVLu8AuO4QxnpfybgqP2vhYDo=; b=F4v9PvT+VDQ030nzX2N1EaMphV6sub5dDx7Xbx6BvBEWa8tyrAaKGudD2/AkTtzz9e xLfEmLsKKzaLSfwaPMlEyzhMmI3cKHCp6/Wbz7awTZy04F8f+f0HWUOhwvcIywjhuobH 62fkWREaBb2EtRJ4+zvUbDDZKRi4IYEVCdqfY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=klMgTk2YA2M4WsgCOVdP6xGL6nqv6KIvfHzJk/Og0YLQLjD3LBGkZMM8FqVd7hAVBX 5vx9R2bBqeEtA0hKZSZje4jIgRYMLv3jHWDYlCKohEvgSJsw7mez6YLiwZu5gZkX/p7C WcgksRNhCYpckKVdKIURjexaRDq21dzVYI9lk= Received: by 10.204.26.152 with SMTP id e24mr4367447bkc.119.1260004630320; Sat, 05 Dec 2009 01:17:10 -0800 (PST) Received: from debian.bg45.phnet (176-232.2-85.cust.bluewin.ch [85.2.232.176]) by mx.google.com with ESMTPS id 15sm94879bwz.4.2009.12.05.01.17.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Dec 2009 01:17:08 -0800 (PST) Message-ID: <4B1A24FD.9080802@gmail.com> Date: Sat, 05 Dec 2009 10:16:45 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20091202202646.GD23641@turki.gavron.org> <4B17D641.4070000@gmail.com> <20091203180151.GH23641@turki.gavron.org> <4B181E7F.7030809@gmail.com> <20091203222523.GA2969@turki.gavron.org> <4B184135.2090402@gmail.com> <20091205022656.GC2958@turki.gavron.org> In-Reply-To: <20091205022656.GC2958@turki.gavron.org> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7242AC231D2442DB452F8BBB" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [solved] Re: USB device not seen by grub X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 09:17:17 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7242AC231D2442DB452F8BBB Content-Type: multipart/mixed; boundary="------------050107010506010900060409" This is a multi-part message in MIME format. --------------050107010506010900060409 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Chris Jones wrote: > On Thu, Dec 03, 2009 at 05:52:37PM EST, Vladimir '=CF=86-coder/phcoder'= Serbinenko wrote: > > [..] > > =20 >> This is just module loading. I guess your terminal is slow which cause= s >> an enormous slowback when loading module. You can using >> =20 > > =20 >> debug=3Dusb,uhci,ohci >> instead of >> debug=3Dall >> =20 > > I was able to boot the partition I had copied over to the USB stick aft= er > this: > > grub:> debug=3Duhci,ohci,usbms > grub:> insmod uhci > grub:> insmod usbms > grub:> debug=3D > > Why do I have to enable tracing to make it work? > > =20 Because a dprintf acted as a forgotten millisleep. This patch should fix it. On my machine I still have issues because uhci.c has problems with second port > Also, is there any way I can run the grub command line on a system > that's already booted, so I can explore its possibities in a context > where I have internet access, browse documentation, etc..? > > =20 I'm working on it but the current problem is that I haven't found a syscall in linux to get physical address of a page. Does anyone has a suggestion? > Thanks, > > CJ > > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------050107010506010900060409 Content-Type: text/x-diff; name="uhciclean.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="uhciclean.diff" =3D=3D=3D modified file 'bus/usb/uhci.c' --- bus/usb/uhci.c 2009-10-14 08:11:59 +0000 +++ bus/usb/uhci.c 2009-12-05 09:13:21 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include =20 @@ -435,6 +434,7 @@ grub_uhci_td_t td_prev =3D NULL; grub_usb_err_t err =3D GRUB_USB_ERR_NONE; int i; + grub_uint64_t endtime; =20 /* Allocate a queue head for the transfer queue. */ qh =3D grub_alloc_qh (u, GRUB_USB_TRANSACTION_TYPE_CONTROL); @@ -483,6 +483,7 @@ =20 /* Wait until either the transaction completed or an error occurred. */ + endtime =3D grub_get_time_ms () + 1000; for (;;) { grub_uhci_td_t errtd; @@ -534,6 +535,13 @@ updated. */ grub_dprintf ("uhci", "transaction fallthrough\n"); } + if (grub_get_time_ms () > endtime) + { + err =3D GRUB_USB_ERR_STALL; + grub_dprintf ("uhci", "transaction timed out\n"); + goto fail; + } + grub_cpu_idle (); } =20 grub_dprintf ("uhci", "transaction complete\n"); @@ -573,6 +581,7 @@ struct grub_uhci *u =3D (struct grub_uhci *) dev->data; int reg; unsigned int status; + grub_uint64_t endtime; =20 grub_dprintf ("uhci", "enable=3D%d port=3D%d\n", enable, port); =20 @@ -595,6 +604,7 @@ status =3D grub_uhci_readreg16 (u, reg); grub_uhci_writereg16 (u, reg, status & ~(1 << 9)); grub_dprintf ("uhci", "reset completed\n"); + grub_millisleep (10); =20 /* Enable the port. */ grub_uhci_writereg16 (u, reg, enable << 2); @@ -602,7 +612,10 @@ =20 grub_dprintf ("uhci", "waiting for the port to be enabled\n"); =20 - while (! (grub_uhci_readreg16 (u, reg) & (1 << 2))); + endtime =3D grub_get_time_ms () + 1000; + while (! (grub_uhci_readreg16 (u, reg) & (1 << 2))) + if (grub_get_time_ms () > endtime) + return grub_error (GRUB_ERR_IO, "UHCI Timed out"); =20 status =3D grub_uhci_readreg16 (u, reg); grub_dprintf ("uhci", ">3detect=3D0x%02x\n", status); =3D=3D=3D modified file 'bus/usb/usbhub.c' --- bus/usb/usbhub.c 2009-07-16 22:14:09 +0000 +++ bus/usb/usbhub.c 2009-12-04 16:54:09 +0000 @@ -48,7 +48,7 @@ if (! grub_usb_devs[i]) break; } - if (grub_usb_devs[i]) + if (i =3D=3D 128) { grub_error (GRUB_ERR_IO, "Can't assign address to USB device"); return NULL; @@ -60,6 +60,7 @@ | GRUB_USB_REQTYPE_TARGET_DEV), GRUB_USB_REQ_SET_ADDRESS, i, 0, 0, NULL); + dev->addr =3D i; dev->initialized =3D 1; grub_usb_devs[i] =3D dev; =3D=3D=3D modified file 'commands/usbtest.c' --- commands/usbtest.c 2009-11-09 17:43:53 +0000 +++ commands/usbtest.c 2009-12-04 01:33:17 +0000 @@ -146,6 +146,7 @@ usb_print_str ("Configuration:", dev, config->strconfig); } =20 + if (dev->config[0].descconf) for (i =3D 0; i < dev->config[0].descconf->numif; i++) { int j; --------------050107010506010900060409-- --------------enig7242AC231D2442DB452F8BBB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAksaJQQACgkQNak7dOguQglCsAEAnIyAzanjYDtM54/rD2gsDQqn YUE3txj8wmOLJ3lyOiEA/080I3mZIJ3uhYkRIfvGkVxJzUuiF8r/1DdmSnnHxOVV =Yl3v -----END PGP SIGNATURE----- --------------enig7242AC231D2442DB452F8BBB--