Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OJCwB-0005qu-2k for mharc-grub-devel@gnu.org; Mon, 31 May 2010 17:54:23 -0400 Received: from [140.186.70.92] (port=55234 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJCw7-0005pi-Rn for grub-devel@gnu.org; Mon, 31 May 2010 17:54:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJCw6-00014w-9f for grub-devel@gnu.org; Mon, 31 May 2010 17:54:19 -0400 Received: from smtp-out3.iol.cz ([194.228.2.91]:34439) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJCw5-00014M-Rx for grub-devel@gnu.org; Mon, 31 May 2010 17:54:18 -0400 Received: from antivir5.iol.cz (unknown [192.168.30.212]) by smtp-out3.iol.cz (Postfix) with ESMTP id 25142BC853D for ; Mon, 31 May 2010 21:54:15 +0000 (UTC) Received: from localhost (antivir5.iol.cz [127.0.0.1]) by antivir5.iol.cz (Postfix) with ESMTP id 14E5F28006 for ; Mon, 31 May 2010 23:54:15 +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 z9EouIFkH7wd for ; Mon, 31 May 2010 23:54:14 +0200 (CEST) Received: from port3.iol.cz (unknown [192.168.30.93]) by antivir5.iol.cz (Postfix) with ESMTP id BEA0828005 for ; Mon, 31 May 2010 23:54:14 +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: ArkBAF/MA0xVRnXk/2dsb2JhbAAHgxGBAclwkFuBJoMFawQ Received: from 228.117.broadband3.iol.cz (HELO [192.168.6.160]) ([85.70.117.228]) by port3.iol.cz with ESMTP; 31 May 2010 23:54:14 +0200 From: =?UTF-8?Q?Ale=C5=A1?= Nesrsta To: The development of GNU GRUB In-Reply-To: <4C03AA29.2020807@gmail.com> References: <1268605383.2839.26.camel@homenes1> <4BB657BB.60801@gmail.com> <1270669741.2732.129.camel@homenes1> <4BBCED68.3080900@gmail.com> <1270762038.2730.37.camel@homenes1> <4BC892C3.3090507@gmail.com> <1271794445.4221.93.camel@pracovna> <1274485618.18038.56.camel@pracovna> <4BF86523.4090509@gmail.com> <1274610426.5231.67.camel@pracovna> <4BF93F58.3080307@gmail.com> <1274634978.6742.13.camel@pracovna> <4BF9839A.2030704@gmail.com> <1274813892.18826.36.camel@pracovna> <1275238274.6704.21.camel@pracovna> <4C02E60A.3060407@gmail.com> <4C03AA29.2020807@gmail.com> Content-Type: text/plain; charset=utf-8 Date: Mon, 31 May 2010 23:54:12 +0200 Message-Id: <1275342853.4170.133.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] [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: Mon, 31 May 2010 21:54:21 -0000 Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > > Hello, Ale=C5=A1. I've seen that your assignment was completed. I add= ed you > > to grub contributors. Feel free to create a branch in branches/usb. > > Right now I'm busy but next week I should be able to assist. Perhaps > > even this week. Right now I send uncommitted changes sitting in my > > yeeloongfw branch. It's largely your rebased changes + few other thin= gs > > like shutting the controller down before booting OS to avoid memory u= sed > > by OS to be clobbered by e.g. HCCA. Yes, thanks, I was also sometimes thinking what happens when ohci module is unloaded or OS booting started, but I never had time to check it, I have little bit another priorities... > > Branch usb should contain pci improvements + your usb changes. If you > > have trouble with bzr or are short on time me (or perhaps someone els= e) > > can give a hand. > > This branch can go into mainline. Since mainline usb is in deplorable > > state there is no need to pass this changes through experimental at a= ll. > > Merging into mainline doesn't mean that no further developpement shou= ld > > be done on usb, just that this part is already a huge improvement. > > > > =20 > I've created a branch "usb" where I put all the yeeloong work and > previous version of your patch. Could you merge your latest patch into > it and test the whole on your systems? Ufff, I will try to do it but I am also busy probably whole this week and maybe I will need a help with bzr, I will see... So don't expect it soon. > >> 2. > >> Some devices (at least my APACER cardreader "ID 058f:6366 Alcor Micr= o > >> Corp. Multi Flash Reader") are not working on UHCI. Such device does= not > >> accept any control message and UHCI returns status 0x450007 - it mea= ns > >> STALL during sending SETUP packet. > >> It looks to be the same problem as described by Vladimir: "I have > >> somewhat similar issue with Geode OHCI controller right now: devices= and > >> speeds are correctly seen but trying to send a message results in a = halt > >> in first TD and error code 5.". > >> =20 > >> =20 > > The problem was that the port was plainly off due to Geode reaction o= n > > incorrect writes differring from that of other controllers. > > =20 > >> But I have problem on UHCI, not on OHCI - on computer with OHCI is t= his > >> device working well (it is normal USB Mass Storage Bulk-Only device = with > >> SCSI subclass)! Maybe it depends on "combined controllers" UHCI-EHCI= , > >> OHCI-EHCI (?) - device is working on computer with OHCI only compute= r > >> and it is not working on computer with UHCI-EHCI controller. But any > >> other device is working well on both computers... I don't understand= , I > >> currently have no idea what can be wrong. Does anybody know...? > >> > >> =20 > >> =20 > > Does this device work under OS on this computer? Some ports are plain= ly > > underpowered. This device works fine under Linux and Windows in the same UHCI port. But the underpower can be good idea - OSes are using EHCI, not UHCI and there could be some difference in power handling. On UHCI I cannot find any power handling... And You remember to me that we are not handling overcurrent on OHCI - but I have no idea what to do in this case. > > =20 > >> 3. > >> There is not working USB hub support, GRUB does not see device conne= cted > >> via USB hub - does anybody know some details or have some specificat= ion > >> of USB Hub class ? I cannot find it on USB site (maybe I have not > >> sufficient patience...). > >> > >> > >> I will probably focus in OHCI speed-up now, i.e. I try to do some ot= her > >> handling of ED to prevent changes in OHCI registers which are slowin= g > >> down OHCI performance (OHCI is approx. 3 times slower than UHCI now = from > >> this reason). > >> =20 > >> =20 > > How useful would the interrupts be for this matter? If the answer is > > "very useful" I can implement them. Also we need some restructuring o= f > > code of both ohci and grub in general to decrease the wait time. I th= ink > > specifically all the waits in init sequence. If system has 2 OHCI > > controllers currently you need to wait twice as long as with 1 > > controllers while it's possible to init them in parallel and not wait > > longer than in the case of one controller. I think interrupt is not important in this case, don't hurry. Why: A. Wait in initialization phase is not so critical from my point of view - it happens only once when ohci module is loaded - for example compare it with the time consumed by some BIOS starts... But nothing against such improving, it can be done when interrupts will be available. B. The main problem is changing of Control or Bulk Head registers on begin and end of each transfer because for each transfer we have another allocated memory for ED and after transfer we de-allocate it. It was one of thing which little bit surprised me when I first read OHCI specification and then I saw GRUB source code - it is different than ED/TD handling suggested in OHCI specification. Registry change and ED de-allocation have to be done on really disabled and inactive ED - and such situation is only after SOF (when related list is disabled before, of course). Such waiting can be avoided if EDs memory will not change - we can allocate necessary EDs only once when device is detected and enumerated / configured and do all necessary work only with TDs - in this case, if we will not change ED addresses, it is not necessary to do changes in OHCI registers on each transfer (with exception of "list filled" bit setting but it can be done asynchronously without waiting for SOF in this case) and all should be more faster, I hope as on UHCI. Also TDs have to be handled in little bit different way in this case because each ED must point to one valid memory address of TD structure even if there is no transfer and queue is empty - and this empty TD have to be used as "starting" (first) TD of next transfer - in fact we should do it in the similar way as it is described in OHCI specification in HCD sample. Seth Goldberg wrote: > USB devices are notoriously difficult to get right. During development= of=20 > USB device support (mainly mass-storage devices), we discovered numerou= s=20 > devices, usually super-cheap devices, that were not spec compliant or t= hat=20 > didn't implement this-or-that command, etc. It's truly amazing that th= ey work=20 > at all (they clearly only test on Windows, and that's all they care abo= ut).=20 > So prepare yourself for a LOT of working trying to figure this stuff ou= t (or=20 > at least try to use Linux's implementation as a technical guide to avoi= d=20 > rediscovering all of this horribleness. Yes, I agree, it is never ending story... I am sometimes looking into Linux (for example, issuing the Request Sense after each SCSI command is idea taken from Linux source). Maybe I need to look there more often... But Linux has little bit different "working environment" for USB device driver than GRUB2. Sometimes I am also looking into some USB development forums / development mail lists - but there is lot of unsorted information and it is not easy to find the right case and related solution there... - it is often wasting of time. But, from my point of view, current status is not so bad - I have 10 fairly different USB mass storage devices and all devices are working well on OHCI and 9 of them are working well on UHCI. GRUB2, when it is installed on HD or booting CD, is now able to boot Linux from USB flash on my older computer without BIOS USB booting support. That is what I needed some months ago, i.e. I am satisfied... After all, GRUB2 is bootloader only, so probably nobody can expect full USB functionality as in Linux/Windows... :-) Best regards Ales