[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

--- Comment #7 from Hans Petter Selasky  ---
Created attachment 173916
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173916=edit
Fix XHCI compatibility with QEMU

Hi,

Can you test the attached patch. Looks like a XHCI compatibility issue.

--HPS

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

--- Comment #6 from Nathan Whitehorn  ---
(In reply to Hans Petter Selasky from comment #5)

The QEMU code that is printing the error is this in xhci_configure_slot():


if ((ictl_ctx[0] & 0x3) != 0x0 || (ictl_ctx[1] & 0x3) != 0x1) {
DPRINTF("xhci: invalid input context control %08x %08x\n",
ictl_ctx[0], ictl_ctx[1]);
return CC_TRB_ERROR;
}

Unfortunately, they have several identical error messages from different
places. Does QEMU's emulated xhci work with the amd64 target?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

--- Comment #4 from Nathan Whitehorn  ---
(In reply to Hans Petter Selasky from comment #3)

That is probably true, but I think that can't be the problem in this case, for
two reasons:
1. The host CPU for my QEMU is little-endian, so that change would be a no-op.
2. I have exactly the same problem on real hardware.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

--- Comment #3 from Hans Petter Selasky  ---
Got it. OK, Look at this error:

xhci: output context at 831a000
xhci: invalid input context control  0003
13236@1471749323.871077:usb_xhci_queue_event v 0, idx 8, ER_COMMAND_COMPLETE,
CC_TRB_ERROR, p 0499fdf0, s 0500, c 0x01008401
13236@1471749323.871080:usb_xhci_irq_intx level 1

And this piece of code which I simply Googled:

hcd-xhci.c:

cpu_physical_memory_read(ictx, (uint8_t *) ictl_ctx, sizeof(ictl_ctx));

if (ictl_ctx[0] != 0x0 || ictl_ctx[1] != 0x3) {
fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
ictl_ctx[0], ictl_ctx[1]);
return CC_TRB_ERROR;
}

It looks like the ictl_ctx[1] read should have a le32_to_cpu() wrapper around
it.

--HPS

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

--- Comment #2 from Nathan Whitehorn  ---
(In reply to Hans Petter Selasky from comment #1)

You misunderstand, I think. This is a bog-standard PCI-E XHCI card with
little-endian registers. The driver just doesn't work when the CPU is
big-endian (or, at least, it doesn't work on ppc64 -- I'm assuming the problem
is an endianness one).

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

Hans Petter Selasky  changed:

   What|Removed |Added

 CC||hsela...@freebsd.org

--- Comment #1 from Hans Petter Selasky  ---
Hi,

The FreeBSD XHCI driver only supports little endian PCI interface / register
set and DMA descriptors.

There are no wrappers or flags to support big-endian XHCI yet like with the
EHCI driver.

--HPS

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 212021] xhci(4) broken on big-endian systems

2016-08-20 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212021

Bug ID: 212021
   Summary: xhci(4) broken on big-endian systems
   Product: Base System
   Version: CURRENT
  Hardware: ppc
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: usb
  Assignee: freebsd-usb@FreeBSD.org
  Reporter: nwhiteh...@freebsd.org

Created attachment 173901
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173901=edit
Log from ppc64 QEMU with an xhci controller. usb_debug and xhcidebug have been
set to 10 and QEMU's usb tracing has also been enabled.

xhci(4) times out after interrupts turn on while probing the USB bus on
big-endian hardware, notably newer POWER8 servers that come with USB3.

The problem is reproducible on qemu-system-ppc64 with an emulated xhci device
for debugging without access to the hardware. I've attached a boot log with all
the USB debugging in FreeBSD and QEMU turned on. Nothing was immediately
obvious as the source of the problem but I'm not that familiar with USB.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"