From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OTHVD-0000I6-O2 for mharc-grub-devel@gnu.org; Mon, 28 Jun 2010 12:48:11 -0400 Received: from [140.186.70.92] (port=50546 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTHV7-0000EL-VP for grub-devel@gnu.org; Mon, 28 Jun 2010 12:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTHV6-0006FG-ND for grub-devel@gnu.org; Mon, 28 Jun 2010 12:48:05 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:61253) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTHV6-0006Ev-EC for grub-devel@gnu.org; Mon, 28 Jun 2010 12:48:04 -0400 Received: by bwz9 with SMTP id 9so893508bwz.0 for ; Mon, 28 Jun 2010 09:48:03 -0700 (PDT) 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=3Uflhh1bLXGJ0QnmHbz1XMaSXh+a5CoSTP/08oRBnfc=; b=JYkLTTmeS3jHoY2PGdTHrXIR6v9/hw62dWJIbs+oDrr+BCJtQMVgV2v6+Aa1B903xg m8WmJrKzaHitkq5g/AyEb/bqaOl023s3biHVbYuG4xUuq6t1sJaqaRgzj3mhDOmLb+he Qe9jPchmF9oYVpaNcZhz2vNBxv8z4E3JkVFYs= 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=DoF5LoSVPC3E1krxz7z/xzYCXttLPPLRUK0VnKAagP5PV8WoMWIGX2Yn5snPP/v7C0 xEiFeQEZdrpUDdUf3LicEOysVKgs/TQcGebuBapLGCR+j+5HBJJLM1aR2MecZqO+cfhC KHTf5Cvtgn+8z6q+dgS/HxGkdtQ2AAvhdH6qc= Received: by 10.204.115.204 with SMTP id j12mr3732463bkq.132.1277743683193; Mon, 28 Jun 2010 09:48:03 -0700 (PDT) Received: from debian.bg45.phnet ([81.62.191.77]) by mx.google.com with ESMTPS id u3sm19299504bkz.12.2010.06.28.09.48.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jun 2010 09:48:01 -0700 (PDT) Message-ID: <4C28D240.3000401@gmail.com> Date: Mon, 28 Jun 2010 18:48:00 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: grub-devel@gnu.org References: <1277025782.4952.6.camel@pracovna> <4C250757.9030207@gmail.com> <1277503421.4714.39.camel@pracovna> In-Reply-To: <1277503421.4714.39.camel@pracovna> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigFEA47B0FDC3624856788FF23" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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, 28 Jun 2010 16:48:08 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFEA47B0FDC3624856788FF23 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=3D0 >>> 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 enable = 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 and= > mainly to bring newly connected device to "Default" state (i.e. to stat= e > 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 wil= l > 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: - grub_uhci_writereg16 (u, reg, enable << 9); + grub_uhci_writereg16 (u, reg, 1 << 9); Which seems to always enable the port. > 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 o= r > 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 need= s > 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 alon= e. > 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 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigFEA47B0FDC3624856788FF23 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/ iF4EAREKAAYFAkwo0kAACgkQNak7dOguQgkKkgD/TAv089AWzr+GuP5TY1fTxJye b1Ausrx/QpshW/fj/UQBAKwnDPcbj3IC2ZPZ6qPIeEogT2OOwkPN1xxNounpmyLQ =ZdL4 -----END PGP SIGNATURE----- --------------enigFEA47B0FDC3624856788FF23--