Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NzbFS-00038Y-JV for mharc-grub-devel@gnu.org; Wed, 07 Apr 2010 15:49:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzbFR-000382-7P for grub-devel@gnu.org; Wed, 07 Apr 2010 15:49:13 -0400 Received: from [140.186.70.92] (port=37373 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzbFP-00037u-N3 for grub-devel@gnu.org; Wed, 07 Apr 2010 15:49:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzbFM-0004W0-RI for grub-devel@gnu.org; Wed, 07 Apr 2010 15:49:11 -0400 Received: from smtp-out3.iol.cz ([194.228.2.91]:60083) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzbFM-0004Vs-7P for grub-devel@gnu.org; Wed, 07 Apr 2010 15:49:08 -0400 Received: from antivir5.iol.cz (unknown [192.168.30.212]) by smtp-out3.iol.cz (Postfix) with ESMTP id 3FC22BE0028 for ; Wed, 7 Apr 2010 19:49:05 +0000 (UTC) Received: from localhost (antivir5.iol.cz [127.0.0.1]) by antivir5.iol.cz (Postfix) with ESMTP id D50F72812B for ; Wed, 7 Apr 2010 21:49:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at iol.cz Received: from antivir5.iol.cz ([127.0.0.1]) by localhost (antivir5.iol.cz [127.0.0.1]) (amavisd-new, port 10224) with LMTP id 7vHGxxrvc7md for ; Wed, 7 Apr 2010 21:49:04 +0200 (CEST) Received: from port1.iol.cz (unknown [192.168.30.91]) by antivir5.iol.cz (Postfix) with ESMTP id A3E1A2812A for ; Wed, 7 Apr 2010 21:49:04 +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: AhcGANd9vEtVRnXk/2dsb2JhbAAHgwyBAosUuDaQXIEsgm9uBIYrg3A Received: from 228.117.broadband3.iol.cz (HELO [192.168.4.222]) ([85.70.117.228]) by port1.iol.cz with ESMTP; 07 Apr 2010 21:49:04 +0200 From: =?UTF-8?Q?Ale=C5=A1?= Nesrsta To: The development of GNU GRUB In-Reply-To: <4BB657BB.60801@gmail.com> References: <1268605383.2839.26.camel@homenes1> <4BB657BB.60801@gmail.com> Content-Type: text/plain; charset=utf-8 Date: Wed, 07 Apr 2010 21:49:01 +0200 Message-Id: <1270669741.2732.129.camel@homenes1> 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] [bug #26237] multiple problems with usb devices 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: Wed, 07 Apr 2010 19:49:13 -0000 Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > Ale=C5=A1 Nesrsta wrote: > > Hello, > > > > according to e-mail from Vladimir Serbinenko I am sending patch relat= ed > > to (mostly) OHCI problem (bug #26237). > > Workaround related to grub_memalign problem is removed from patch > > because Vladimir Serbinenko wrotes that it will be corrected. > > =20 > First of all big thanks for debugging this important aspect. And sorry > for being busy lately. >=20 > - GRUB_OHCI_REG_RHUBA =3D 18, > - GRUB_OHCI_REG_RHUBPORT =3D 21 > + GRUB_OHCI_REG_FRAME_REMAINING, > + GRUB_OHCI_REG_FRAME_NUMBER, > + GRUB_OHCI_REG_PERIODIC_START, > + GRUB_OHCI_REG_LS_TRESHOLD, > + GRUB_OHCI_REG_RHUB_DESC_A, >=20 > Please avoid register renaming unless original ones are misnomers. If > they are I would prefer renaming to be a separate patch. No, problem. It is the rest of lot of my experiments. I have added names for some previously missing registers and I also renamed something to be more closed to OHCI specification and understand it, but later I decided that I don't need additional registers and I did not cleanup. >=20 > - grub_ohci_td_t td_list; > + grub_ohci_td_t td_list ; > This change is spurious Hmmm, it is also rest of some experiments which I was not properly cleaned up. I made more changes on this place but I deleted them later... As I wrote in previous e-mail, there can be more such curious changes... >=20 > + * So we should: > + * - allow WritebackDoneHead interrupt (WDH) by proper setting of la= st TD > + * token - it is done above in transaction settings > + * - detect setting of WDH bit in HcInterruptStatus register > + * - compare HccaDoneHead value with address of last-1 TD. If it is = not > + * equal, check ED for halt and if not so, reset WDH bit and wait = again > + * - but it should not happen - debug it! > Are the comments from you or any part copied from spec. We need no copy= from spec as spec is available anyway and sentences copied from it may c= ause copyright problems It is not copy from specification, it is only inspired by OHCI specification. I wrote it mainly for myself (and possibly others) to explain what is the main change against previous algorithm, which is not safe (from my point of view). It can be removed if it is not interesting. "Copied" are "official" names of OHCI registers, bits etc., i.e. HccaDoneHead, WDH bit, HcInterruptStatus etc. - but from my point of view it could be no problem - it is "keyword" which is necessary to "speak with the same language". And it should be aim of such specifications, specially of such "free" specifications as USB specifications are. Or not? I think it is far of any OHCI specification texts - but I have no experiences with code licensing... > +/* Self commenting... */ > Such comments should be removed, but an empty line at this point would = be nice OK > + err_sense =3D grub_scsi_request_sense (scsi); > + /* err_sense is ignored for now and Request Sense Data also... */ > When you ignore an error you need to clean grub_errno. > Sth like > if (!err) > grub_errno =3D GRUB_ERR_NONE; > grub_scsi_cmd_inquiry =3D 0x12, > + grub_scsi_cmd_test_unit_ready =3D 0x00, >=20 I will check it. > Please keep this list sorted. > -#define GRUB_USB_FEATURE_ENDP_HALT 0x01 > -#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x02 > -#define GRUB_USB_FEATURE_TEST_MODE 0x04 > +#define GRUB_USB_FEATURE_ENDP_HALT 0x00 > +#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x01 > Why do you need to change these constants? Were they wrong? > Tomorrow I'll test your patch on both UHCI and OHCI. Yes, I found they are wrong. But I cannot remember the source of such information (maybe it was USB Mass Storage Class Compliance Test Specification but I am not sure). >=20 > +#define GRUB_USB_FEATURE_TEST_MODE 0x02 > grub_scsi_cmd_read_capacity =3D 0x25, > + >=20 > > Patch was done by: > > > > diff -urB grub2-1.98~experimental.20100120 grub2-1.98~my_patched.201= 00312 > grub2-1.98~my_patched.20100312.patch > > > > As I shortly read the patch file, there sometimes remains some few > > things which can be optimized - sorry, it is mostly the rest from > > debugging experiments (even I make cleaning of code today)... > > > > Ales > > > > =20 > >> Od: Vladimir Serbinenko > >> Komu: Oliver Henshaw , Vladimir Serbinenko > >> , Ales Nesrsta , bug-grub@gnu.o= rg > >> P=C5=99edm=C4=9Bt: [bug #26237] multiple problems with usb devices > >> Datum: Sat, 13 Mar 2010 22:08:44 +0000 > >> > >> Update of bug #26237 (project grub): > >> > >> Release: None =3D> Bazaar - trun= k =20 > >> > >> _______________________________________________________ > >> > >> Follow-up Comment #6: > >> > >> Hello. I found out the problem with grub_memalign. I'll apply the pa= tch > >> tomorrow. Some of the fixes can go directly in while other require > >> investigation and perhaps even copyright assignment. Can you remove = all > >> gratuituous changes (like commenting out dprintfs, adding commented = out code > >> and change register names) and send patch in unified format (-u opti= on in > >> diff) to grub-devel@gnu.org? Porting code from linux is appropriate = only if > >> license is compatible and porting was approved by maintainer. Are pe= rhaps > >> interested in coding EHCI? > >> > >> _______________________________________________________ > >> > >> Reply to this item at: > >> > >> > >> > >> _______________________________________________ > >> Message sent via/by Savannah > >> http://savannah.gnu.org/ > >> > >> > >> =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 Some questions and others: I am not so far oriented in such kind of development, so I am asking: Will You correct my patch yourself (as maintainer of code) or should I prepare new corrected code and related patch? And against which version - I noted that in meantime new official version was released... Did You tests on OHCI/UHCI and what was the result? What HW are You using for testing - some real PC or qemu ? It was little bit surprise for me that OHCI and UHCI drivers are not using IRQ (and maybe also some other drivers). Is it intention of GRUB? Nothing against such philosophy, some things are easier in this way. I shortly read the UHCI specification and I was thought about my comments of TD buffer size optimalization included in patch - such optimization cannot be done simply because TD preparation code is common for OHCI and UHCI and: - UHCI needs (as far as I understand) TD buffer size length up to packet size only (<=3D64 bytes). - In contradiction, OHCI allows up to 8Kbytes TD buffer size (if buffer is aligned to page). So there is the question if it make sense to do any optimization for OHCI - probably not. In fact slow data transfer and wasting of memory caused by not optimized TD buffer is probably not so big problem. I read also part of EHCI specification. There is question if GRUB 2 needs support of EHCI because: 1. According to EHCI specification, each EHCI interface should normaly have also OHCI (or UHCI ?) interface. So, any USB 2.0 interface should work (slowly) via GRUB2 UHCI/OHCI support. 2. EHCI is relative new HW - so it was usually used on PCs with BIOS which supports booting from USB - so, probably, there is not necessary to prepare special support in GRUB for such HW. But maybe I am wrong. Best regards Ales