bugGNU GRUB - Bugs: bug #26237, multiple problems with usb devices

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26237: multiple problems with usb devices

Submitter:  Oliver Henshaw <oliverhenshaw>
Submitted:  Sun 19 Apr 2009 01:12:34 PM UTC
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  Bazaar - trunk
Release:  r2127 Reproducibility:  Every Time
Planned Release:  None

( Jump to the original submission )

Sun 14 Mar 2010 09:47:49 PM UTC, comment #7: 

Hello,

there are answers.

>...I found out the problem with grub_memalign.


OK, so I removed my workaround in HCCA allocation in patch.

>...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 option in diff) to grub-devel@gnu.org?


I cleaned the code, shortly tested if it is still working, made the patch by "diff -urB" and sent it to grub-devel@gnu.org.
But as I did not participate on any Linux, GNU or another project until now, I am, for example, not sure if is it correct to do my patches according to grub2-1.98~experimental.20100120 source or if I should download some latest code tarball (if any)... Or if I should participate via CVS (I never used this tool and have no experiences...).

>...Porting code from linux is appropriate only if license is compatible and porting was approved by maintainer.


I never understand any license in details as I cannot be thinking as lawyer...
From my point of view, I did not port (copy) the code, I only used Linux developers experiences described in their notes, so I hope I don't need any approval.
I only shortly read part of Linux sources related to USB mass storage driver and I found in notes that there can be problem with USB mass storage devices if no Request Sense is performed after each command. By the way, I am not sure if I understand these notes in right way...
I don't know if lawyers have the same point of view...

>...Are perhaps interested in coding EHCI?


I am personally not interested, as I do not have PC with EHCI which have no support for boot in BIOS.
But if You want to add EHCI module to GRUB2 or something like it and You need help, I can try to help You, I like programming on "device level".

But first please consider following facts and think over if I am suitable person for You:
1.
Improvement of GRUB2 OHCI module is my first try of participating in any free SW development. I only tried to solve this bug myself and when it looked that it is working, I send it to You mainly for review if it can be useful also for others.
2.
Till now I have no knowledges about UHCI and EHCI (as I had no knowledges about OHCI and USB MS approx. three weeks ago...).
This case was my first "meeting" with OHCI and USB mass storage devices specifications - I am not specialist, I downloaded specifications from www.usb.org, read them and try to compare it with GRUB2 code etc.
From SCSI side I have only very basic knowledges related to old SCSI2 draft document which I historically shortly read many years ago according to my experiments with building my own QIC02 SCSI miniport driver for Windows NT.
3.
I cannot do development systematically and fast due to my job, family and another, mostly non-predicate reasons. Sometimes I have some free time for such development, but often not. It can happen that I will be do nothing (nor responding) one, two, three weeks or more...

Ales

Ales Nesrsta <starous>
Project Member
Sat 13 Mar 2010 10:08:44 PM UTC, comment #6: 

Hello. I found out the problem with grub_memalign. I'll apply the patch 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 option 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 perhaps interested in coding EHCI?

Vladimir Serbinenko <phcoder>
Project Administrator
Fri 12 Mar 2010 10:38:32 PM UTC, comment #5: 

Hello,

booting from OHCI is working now (slowly but probably safely).
I attached the patch grub2-1.98~my_patched.20100312.patch related to grub2-1.98~experimental.20100120 source tarball.

Changed files:
ohci.c (memory align problem, change of HW handling)
usbtrans.c (some changes and maybe important comment)
scsi.c (new commands)
usbms.c (some changes in initialization and bulk operations)
scsicmd.h (new commands)
usbtrans.h (bad code of USB command)

There was these main problems/changes:
Probably not correct handling of OHCI HW.
Memory for HCCA was sometimes not aligned to 0x100 (!???)
Handling of bulk transfers
Some bad USB codes.
As I read in linux sources, many devices have problem if Request Sense command is not used after any SCSI command.

Still remains - to do:
1.
Possibly bad handling of toggle bit.
2.
Wasting of memory in bulk transfers (only 64 bytes per TD).

It is written in my comment in usbtrans.c.
Maybe I try to do it but I am not sure if I will have sufficient time now.

As I changed code which is probably used also for another devices (at least for UHCI USB mass storage) and maybe affects
another parts of grub code, these changes should be tested on
affected devices - but I cannot do it...

With regards
Ales

(file #19924)

Ales Nesrsta <starous>
Project Member
Fri 26 Feb 2010 04:07:12 PM UTC, comment #4: 

Hello,
I have also problem related (probably) to this bug.
I am running Debian Lenny on TOSHIBA Satellite 2140CDS laptop. BIOS of this PC does not support booting from USB, so I tried GRUB2, which promises this functionality.
But GRUB2 USB boot does not work on this PC - GRUB2 hangs after "insmod usbms" and following "ls".

A attach two files:
lspci.txt - my PCI devices
grub2_ohci_problem.txt - behavior of the problem

On Linux USB is working normally.
From lspci I found that OHCI (USB 1.1) chip is NEC family, probably related to some "quirk" in kernel OHCI module.

I tried GRUB versions 1.97beta3 and also Debian last source snapshot 1.98~experimental.20100120 - the behavior is the same in both cases.

Ales

(file #19798, file #19799)

Ales Nesrsta <starous>
Project Member
Wed 17 Jun 2009 01:22:50 PM UTC, comment #3: 

Has your patch that we committed recently fixed all this bugs? If it has please close this bugreport. Otherwise say which problems remain

Vladimir Serbinenko <phcoder>
Project Administrator
Thu 07 May 2009 01:12:56 PM UTC, comment #2: 

With the attached patch, 'insmod ohci' no longer crashes. But

  • 'insmod uhci' still hangs the computer. If I set debug=uhci, then module loading completes but 'usb' resets the computer.
  • 'insmod ohci' completes, but doesn't seem to register the usb ports or the attached devices. 'usb' returns blank.
Oliver Henshaw <oliverhenshaw>
Sun 19 Apr 2009 01:31:28 PM UTC, comment #1: 

I can boot with the stanza:

        set debug=uhci
        insmod uhci
        unset debug
        insmod usbms
        set root=(usb0,1)
        linux /syslinux/vmlinuz0 root=UUID=596A-F3D2 rootfstype=vfat ro liveimg quiet rhgb
        initrd /syslinux/initrd0.img

however,

  • the system is extremely slow with disk access at usb 1.1 speeds
  • chainloading to syslinux (in order to take advantage of the configuration written by the fedora live-cd tools) fails.
  • this won't allow me to put multiple iso images on the stick, unless I write a script to translate syslinux config to grub2 config.
Oliver Henshaw <oliverhenshaw>
Sun 19 Apr 2009 01:12:34 PM UTC, original submission:  

I'm trying to use grub2 to boot from usb on a legacy system where the bios can't see the usb drive. The machine has (via) usb 1.1 ports attached to the motherboard and usb 2.0 ports on a (nec) pci card.

However, 'insmod uhci' hangs grub if any devices are attached to the usb 1.1 ports, and 'insmod ohci' always hangs grub. Grub survives if I 'set debug=uhci', and recognises devices on the usb 1.1 ports (but does not on the usb 2.0 ports). With 'set debug=ohci', the output seems to carry on forever.

I captured the output from a serial console, it can be found attached in the following comment(s). Attached here are the results of 'lspci -v' for the usb controllers and 'lsusb -v' on i686 Fedora 10.

I encountered this problem when I first tried grub2 from svn, around April 1st, and it persists with svn r2127.

Oliver Henshaw <oliverhenshaw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #19798:  lspci.txt added by starous (862B - text/plain)
file #19799:  grub2_ohci_problem.txt added by starous (6KiB - text/plain)
file #18110:  ohci_mouse.txt added by oliverhenshaw (786B - text/plain - output of 'insmod ohci', fails to detect usb mouse)
file #18109:  uchi_mouse_usb.txt added by oliverhenshaw (2KiB - text/plain - output of 'insmod uhci' and 'usb' (which resets) with mouse attached. Almost identical to file #17957, apart from different td values and now debug="uhci usb".)
file #18108:  usb-check-interface.patch added by oliverhenshaw (2KiB - text/x-patch - patch to check interface for uhci and ohci. ohci no longer hangs, uhci still has problems.)
file #17959:  uhci_usbms_usb.txt added by oliverhenshaw (9KiB - text/plain - Output from 'insmod uhci; insmod usbms; usb'.)
file #17958:  insmod_ohci.txt added by oliverhenshaw (1KiB - text/plain - 'insmod ohci' - the last line repeats indefinitely)
file #17957:  insmod_uhci_mouse.txt added by oliverhenshaw (2KiB - text/plain - 'insmod uhci' with a usb mouse attached)
file #17956:  insmod_uhci_nomouse.txt added by oliverhenshaw (403B - text/plain - 'insmod uhci' with no devices attached)
file #17954:  my_pci.txt added by oliverhenshaw (2KiB - text/plain - output of 'lsusb -v' and selected 'lspci -v' on fedora 10. )
file #17955:  my_usb.txt added by oliverhenshaw (15KiB - text/plain - output of 'lsusb -v' and selected 'lspci -v' on fedora 10. )

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by starous (Updated the item)
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by oliverhenshaw (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

     

     

    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-10-16 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2010-03-13 phcoder ReleaseNone Bazaar - trunk
    2010-03-12 starous Attached File- Added grub2-1.98~my_patched.20100312.patch, #19924
    2010-02-26 starous Attached File- Added lspci.txt, #19798
        Attached File- Added grub2_ohci_problem.txt, #19799
    2009-05-07 oliverhenshaw Attached File- Added ohci_mouse.txt, #18110
    2009-05-07 oliverhenshaw Attached File- Added uchi_mouse_usb.txt, #18109
    2009-05-07 oliverhenshaw Attached File- Added usb-check-interface.patch, #18108
    2009-04-19 oliverhenshaw Attached File- Added uhci_usbms_usb.txt, #17959
    2009-04-19 oliverhenshaw Attached File- Added insmod_ohci.txt, #17958
    2009-04-19 oliverhenshaw Attached File- Added insmod_uhci_mouse.txt, #17957
    2009-04-19 oliverhenshaw Attached File- Added insmod_uhci_nomouse.txt, #17956
    2009-04-19 oliverhenshaw Attached File- Added my_pci.txt, #17954
        Attached File- Added my_usb.txt, #17955

    Back to the top


    Powered by Savane 3.9