Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OVpDK-0005AH-3n for mharc-grub-devel@gnu.org; Mon, 05 Jul 2010 13:12:14 -0400 Received: from [140.186.70.92] (port=33010 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVpDH-00058w-1o for grub-devel@gnu.org; Mon, 05 Jul 2010 13:12:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVpDF-0001dd-JS for grub-devel@gnu.org; Mon, 05 Jul 2010 13:12:10 -0400 Received: from smtp-out4.iol.cz ([194.228.2.92]:51120) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVpDF-0001dT-8h for grub-devel@gnu.org; Mon, 05 Jul 2010 13:12:09 -0400 Received: from antivir6.iol.cz (unknown [192.168.30.215]) by smtp-out4.iol.cz (Postfix) with ESMTP id 58F42CE5231 for ; Mon, 5 Jul 2010 17:12:08 +0000 (UTC) Received: from localhost (antivir6.iol.cz [127.0.0.1]) by antivir6.iol.cz (Postfix) with ESMTP id 4599C720057 for ; Mon, 5 Jul 2010 19:12:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at iol.cz Received: from antivir6.iol.cz ([127.0.0.1]) by localhost (antivir6.iol.cz [127.0.0.1]) (amavisd-new, port 10224) with LMTP id q9HxIu93pbb1 for ; Mon, 5 Jul 2010 19:12:08 +0200 (CEST) Received: from port5.iol.cz (unknown [192.168.30.95]) by antivir6.iol.cz (Postfix) with ESMTP id 199F5720055 for ; Mon, 5 Jul 2010 19:12:08 +0200 (CEST) X-SBRS: None X-SBRS-none: None X-RECVLIST: MTA-OUT-IOL X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIBALavMUxVRnXk/2dsb2JhbAAHgxaBAcoykHyBKYMKcgSHZA Received: from 228.117.broadband3.iol.cz (HELO [192.168.6.160]) ([85.70.117.228]) by port5.iol.cz with ESMTP; 05 Jul 2010 19:12:07 +0200 From: =?UTF-8?Q?Ale=C5=A1?= Nesrsta To: The development of GNU GRUB In-Reply-To: <4C28D240.3000401@gmail.com> References: <1277025782.4952.6.camel@pracovna> <4C250757.9030207@gmail.com> <1277503421.4714.39.camel@pracovna> <4C28D240.3000401@gmail.com> Content-Type: text/plain; charset=utf-8 Date: Mon, 05 Jul 2010 19:12:06 +0200 Message-Id: <1278349926.4721.20.camel@pracovna> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [Patch] USB UHCI portstatus correction 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: Mon, 05 Jul 2010 17:12:12 -0000 Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > On 06/26/2010 12:03 AM, Ale=C5=A1 Nesrsta wrote: > > Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > > =20 > >> On 06/20/2010 11:23 AM, Ale=C5=A1 Nesrsta wrote: > >> =20 > >>> Hi, > >>> > >>> I found some mistake in uhci.c in grub_uhci_portstatus when enable=3D= 0. > >>> There is proposal of correction. > >>> > >>> Without correction portstatus reported false timeout when enable=3D= 0 > >>> because it is waiting for reset to be done but none is performed... > >>> > >>> =20 > >>> =20 > >> This patch seems to change much more that you say. In particular > >> enable=3D0 is a request to disable port and you seem to always enabl= e it. > >> This is likely to break other code. > >> =20 > > Hi, > > You are right according to some possible side-effects. But the lines > > ... > > if (!enable) /* We don't need reset port */ > > { > > /* Disable the port. */ > > grub_uhci_writereg16 (u, reg, 0 << 2); > > ... > > should disable the port as the bit "Port Enable" is reset. > > > > Port reset should be not necessary when disabling port - according to > > USB specification, reset of port should be done only to enable port a= nd > > mainly to bring newly connected device to "Default" state (i.e. to st= ate > > when device accepts communication via address 0). > > > > Of course: > > - I can be wrong > > - it should be tested according to some side-effect > > > > But in original code is real bug - if this function is called with > > enable=3D0, it reports false timeout as it is waiting for bit which w= ill > > never set in this case. > > This bug should be corrected in some way. > > > > =20 > I have nothing against that change. I was mainly referring to: >=20 > - grub_uhci_writereg16 (u, reg, enable << 9); > + grub_uhci_writereg16 (u, reg, 1 << 9); > Which seems to always enable the port. >=20 OK, I committed it into trunk as rev. 2522. Regards, Ales >=20 > > There is also question, why does the function attach_root_port (in > > usbhub.c) disable and enable of port before initialize connected > > device ? > > Reset & enable of port (if new device is connected) should be enough, > > because, according to USB specification: > > - hub should automatically disable the port if device is disconnected= or > > port is not powered > > - ports should be disabled by hub after power-up of hub > > But maybe there are some special cases or buggy hubs/devices which ne= eds > > such behavior (?) - I don't know, so I didn't touch this part of code= . > > > > =20 > It's the right strategy: if it doesn't bug and unlikely to, leave it al= one. > > Best regards > > Ales > > > > =20 > >>> Best regards > >>> Ales > >>> =20 > >>> > >>> > >>> _______________________________________________ > >>> Grub-devel mailing list > >>> Grub-devel@gnu.org > >>> http://lists.gnu.org/mailman/listinfo/grub-devel > >>> =20 > >>> =20 > >> > >> _______________________________________________ > >> Grub-devel mailing list > >> Grub-devel@gnu.org > >> http://lists.gnu.org/mailman/listinfo/grub-devel > >> =20 > > > > _______________________________________________ > > Grub-devel mailing list > > Grub-devel@gnu.org > > http://lists.gnu.org/mailman/listinfo/grub-devel > > > > =20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel