Building the seabios defconfig on a 64-bit Debian Wheezy system I'm
seeing:
Compiling (16bit) out/romlayout.o
src/romlayout.S: Assembler messages:
src/romlayout.S:285: Error: expecting string instruction after `rep'
make: *** [out/romlayout.o] Error 1
That line is:
// Acquire lock and take ownership of shared stack
1: rep nop
I've also checked the preprocessed version and the nop isn't being
disappeared or anything like that.
This is with 083ee297ef88d "ohci: Update usb command timeouts to use
usb_xfer_time()". I don't see it with the rel-1.7.5 tag.
git bisect has fingered 0673b7870063a ""smp: Replace QEMU SMP init
assembler code with C; run only in 32bit mode.", which makes sense since
it made those additions to romlayout.S
Other than a compiler bug I can't think what might be going on. Debian
Wheezy has gcc 4.7.2 and binutils 2.22.
Ian.
On 6/22/2014 5:04 AM, Kevin O'Connor wrote:
> On Sat, Jun 21, 2014 at 01:24:24PM -0500, Matt DeVillier wrote:
>> On 6/21/2014 1:22 PM, Kevin O'Connor wrote:
>>> The above is fine. Can you also post 'lsusb -t' and 'lsusb -v' output
>>> for the device? I'll take a look later tonight.
>> does it need to be from the same SeaBIOS build? I'd imagine not
>> since the device works in the OS either way. But if so I'll need to
>> recompile/reflash first since I have a working one loaded now
> No - the lsusb reports info on the device - it shouldn't matter what
> version of seabios is in use. Can you post the full seabios log as
> well?
>
> Please CC the seabios mailing list on the response.
>
> -Kevin
Kevin,
here's the relevant snippet of the cbmem output for the non-working keyboard:
SeaBIOS (version rel-1.7.5-8-g11a8d89-20140623-MattDevo)
init usb
XHCI init on dev 00:14.0: regs @ 0xe0700000, 13 ports, 32 slots, 32 byte contexts
XHCI protocol USB 2.00, 9 ports (offset 1), def 3018
XHCI protocol USB 3.00, 4 ports (offset 10), def 1000
XHCI extcap 0xc1 @ e0708040
XHCI extcap 0xc0 @ e0708070
XHCI extcap 0x1 @ e0708460
XHCI extcap 0xa @ e0708480
configure_xhci: resetting
configure_xhci: setup 16 scratch pad buffers
xhci_hub_detect port #1: 0x000002a0, powered, pls 5, speed 0 [ - ]
xhci_hub_detect port #2: 0x000002a0, powered, pls 5, speed 0 [ - ]
xhci_hub_detect port #3: 0x00020ae1, powered, pls 7, speed 2 [Low]
xhci_hub_reset port #3: 0x00020ae1, powered, pls 7, speed 2 [Low]
XHCI port #3: 0x00200a03, powered, enabled, pls 0, speed 2 [Low]
set_address 0x000ef720
xhci_alloc_pipe: usbdev 0x7f6640d0, ring 0x7f6aeb00, slotid 0, epid 1
xhci_cmd_enable_slot:
xhci_trb_queue: ring 0x7f6aed00 [nidx 1, len 0]
xhci_process_events: status change port #3
xhci_process_events: status change port #4
xhci_process_events: status change port #3
xhci_process_events: ring 0x7f6aed00 [trb 0x7f6aed00, evt 0x7f6aee00, type 33, eidx 1, cc 1]
xhci_alloc_pipe: enable slot: got slotid 1
xhci_cmd_address_device: slotid 1
xhci_trb_queue: ring 0x7f6aed00 [nidx 2, len 0]
xhci_process_events: ring 0x7f6aed00 [trb 0x7f6aed10, evt 0x7f6aee00, type 33, eidx 2, cc 1]
xhci_update_pipe: usbdev 0x7f6640d0, ring 0x7f6aeb00, slotid 1, epid 1
config_usb: 0x7f6aec20
xhci_trb_queue: ring 0x7f6aeb00 [nidx 1, len 8]
xhci_trb_queue: ring 0x7f6aeb00 [nidx 2, len 8]
xhci_trb_queue: ring 0x7f6aeb00 [nidx 3, len 0]
xhci_xfer_kick: ring 0x7f6aeb00, slotid 1, epid 1
xhci_process_events: ring 0x7f6aeb00 [trb 0x7f6aeb20, evt 0x7f6aec00, type 32, eidx 3, cc 1]
device rev=0110 cls=00 sub=00 proto=00 size=8
xhci_update_pipe: usbdev 0x7f6640d0, ring 0x7f6aeb00, slotid 1, epid 1
xhci_trb_queue: ring 0x7f6aeb00 [nidx 4, len 8]
xhci_trb_queue: ring 0x7f6aeb00 [nidx 5, len 9]
xhci_trb_queue: ring 0x7f6aeb00 [nidx 6, len 0]
xhci_xfer_kick: ring 0x7f6aeb00, slotid 1, epid 1
xhci_process_events: ring 0x7f6aeb00 [trb 0x7f6aeb40, evt 0x7f6aec00, type 32, eidx 5, cc 6]
WARNING - Timeout at xhci_event_wait:394!
xhci_control: control xfer failed (cc -1)
...
thanks,
Matt
The SeaBIOS USB drivers all have different timeouts for USB commands.
The USB specification does specify maximum command times (section
9.2.6). In particular, it states that all commands are expected to
complete within 5 seconds.
This series unifies the command timeouts across the drivers.
Generally, the timeout is increased to 5 seconds for all commands.
This fixes an issue reported by some users of USB flash drives on XHCI
controllers (the xhci controller had a 1 second bulk timeout).
The control command timeouts are also increased to 5 seconds except
for the set_address command. This is reduced to 150ms (spec caps
device to 50ms) to prevent 5 second hangs should a port report a
device that isn't actually there. Once the driver starts talking to a
device it would be very unusual to timeout on a command, so there
shouldn't be any problem with a limit of five seconds.
-Kevin
Kevin O'Connor (4):
xhci: Update the times for usb command timeouts.
ehci: Update usb command timeouts to use usb_xfer_time()
uhci: Update usb command timeouts to use usb_xfer_time()
ohci: Update usb command timeouts to use usb_xfer_time()
src/hw/usb-ehci.c | 11 ++++++-----
src/hw/usb-ohci.c | 7 +++----
src/hw/usb-uhci.c | 13 ++++++-------
src/hw/usb-xhci.c | 4 ++--
src/hw/usb.c | 13 +++++++++++++
src/hw/usb.h | 5 +++++
6 files changed, 35 insertions(+), 18 deletions(-)
--
1.9.3
On Sat, Jun 21, 2014 at 08:46:05PM +0200, Idwer Vollering wrote:
> 2014-06-21 20:22 GMT+02:00 Kevin O'Connor <kevin(a)koconnor.net>:
> > On Sat, Jun 21, 2014 at 01:15:25PM -0500, Matt DeVillier wrote:
> >> On 6/21/2014 1:08 PM, Kevin O'Connor wrote:
> (cut)
>
> I'm experiencing similar trouble booting off native XHCI hardware:
>
> SeaBIOS (version rel-1.7.5-20-g67fd42c-dirty-20140617_200600-ubuntu)
> init usb
> XHCI init on dev 00:10.0: regs @ 0xf0248000, 4 ports, 32 slots, 32 byte contexts
> XHCI extcap 0x1 @ f0248500
> XHCI protocol USB 3.00, 2 ports (offset 1), def 0
> XHCI protocol USB 2.00, 2 ports (offset 3), def 0
> configure_xhci: resetting
> xhci_hub_detect port #1: 0x000002a0, powered, pls 5, speed 0 [ - ]
> xhci_hub_detect port #2: 0x000002a0, powered, pls 5, speed 0 [ - ]
> xhci_hub_detect port #3: 0x000002a0, powered, pls 5, speed 0 [ - ]
> xhci_hub_detect port #4: 0x000202e1, powered, pls 7, speed 0 [ - ]
> xhci_hub_reset port #4: 0x000202e1, powered, pls 7, speed 0 [ - ]
> XHCI port #4: 0x00200e03, powered, enabled, pls 0, speed 3 [High]
> set_address 0x000ef720
> xhci_alloc_pipe: usbdev 0xbf0d37f0, ring 0xbf11fb00, slotid 0, epid 1
> xhci_cmd_enable_slot:
> xhci_process_events: status change port #4
> xhci_process_events: status change port #2
> xhci_process_events: status change port #4
> xhci_alloc_pipe: enable slot: got slotid 1
> xhci_cmd_address_device: slotid 1
> WARNING - Timeout at xhci_event_wait:394!
So, this looks different from Matt's report. What appears to be
happening in the above is that the device shows up originally as a
high speed device (see "[High]" above). However, when the set_address
command is sent to it, it appears that the device effectively
disconnects and then reconnects as a super speed device (see "change
port #2" and "change port #4" above - port 2==port 4 - see ("offset 1"
/ "offset 3" above)).
You can try increasing the xchi_event_wait timeout which fixes Matt's
issue, but I think we tried this on your hardware before with no luck.
SeaBIOS isn't coded to support new devices being attached dynamically,
and this is really the limitation here. It's not so much an XHCI
issue as it is a dynamic connection thing (SeaBIOS checks port 2,
finds nothing, goes on to check port 4, finds a device there, that
device goes away, a new device shows up on port 2, but SeaBIOS has
already checked port 2 and wont check it again).
It's possible to make this work in SeaBIOS, but it would require some
restructuring of the USB code. Can you check if this happens to all
super speed devices on your controller or just this device? Is the
device bootable with the factory BIOS? I'm not sure if it's
worthwhile to add lots of code if this is just limited to a single
quirky device.
-Kevin
On Sat, Jun 21, 2014 at 08:46:05PM +0200, Idwer Vollering wrote:
> 2014-06-21 20:22 GMT+02:00 Kevin O'Connor <kevin(a)koconnor.net>:
> > On Sat, Jun 21, 2014 at 01:15:25PM -0500, Matt DeVillier wrote:
> >> On 6/21/2014 1:08 PM, Kevin O'Connor wrote:
> (cut)
>
> I'm experiencing similar trouble booting off native XHCI hardware:
[...]
> > The above is fine. Can you also post 'lsusb -t' and 'lsusb -v' output
> > for the device? I'll take a look later tonight.
>
> $ sudo lsusb -t
> /: Bus 09.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
> /: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
> /: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
> /: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
> /: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/2p, 12M
> /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/5p, 12M
> /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/5p, 12M
> |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
> |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
> /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/5p, 480M
> /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/5p, 480M
> |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
> |__ Port 4: Dev 4, If 0, Class=Vendor Specific Class,
> Driver=r8712u, 480M
Which device is having the problem? (I don't see any super speed
devices in the above.)
-Kevin
On Sat, Jun 21, 2014 at 01:15:25PM -0500, Matt DeVillier wrote:
> On 6/21/2014 1:08 PM, Kevin O'Connor wrote:
> > On Sat, Jun 21, 2014 at 12:20:21PM -0500, Matt DeVillier wrote:
> >> I still have issues with various USB sticks not being detected at
> >> boot due to the xhci_event_wait() call in xhci_cmd_submit() which
> >> still has a timeout of 1000ms (vs 5000 for the ones affected by this
> >> patch). Manually setting it to 5000 fixes the issues with all the
> >> USB flash devices I've tested (which had a problem at 1000ms)
> > Thanks Matt. Can you post the SeaBIOS log with one of these devices?
>
> Can do - what would you like the logging level set to? Currently
> have it set to 3, which produces the following:
>
> xhci_hub_reset port #2: 0x00020ae1, powered, pls 7, speed 2 [Low]
> XHCI port #2: 0x00200a03, powered, enabled, pls 0, speed 2 [Low]
> set_address 0x000ef720
> xhci_alloc_pipe: usbdev 0x7f7378d0, ring 0x7f781b00, slotid 0, epid 1
> xhci_cmd_enable_slot:
> xhci_process_events: status change port #2
> xhci_process_events: status change port #3
> xhci_process_events: status change port #4
> xhci_process_events: status change port #2
> xhci_alloc_pipe: enable slot: got slotid 1
> xhci_cmd_address_device: slotid 1
> xhci_update_pipe: usbdev 0x7f7378d0, ring 0x7f781b00, slotid 1, epid 1
> config_usb: 0x7f781c20
> device rev=0110 cls=00 sub=00 proto=00 size=8
> xhci_update_pipe: usbdev 0x7f7378d0, ring 0x7f781b00, slotid 1, epid 1
> WARNING - Timeout at xhci_event_wait:394!
> xhci_control: control xfer failed (cc -1)
The above is fine. Can you also post 'lsusb -t' and 'lsusb -v' output
for the device? I'll take a look later tonight.
-Kevin