Re: current amd64 crashes in usb_transfer_complete

2016-08-12 Thread Takahiro Hayashi
Could you try both of http://www.netbsd.org/~skrll/usb.softint.diff https://mail-index.netbsd.org/tech-kern/2016/08/09/msg020963.html and check if you can still see the problem? Thanks, -- t-hash

Re: current amd64 crashes in usb_transfer_complete

2016-08-12 Thread Takahiro Hayashi
Could you try both of http://www.netbsd.org/~skrll/usb.softint.diff https://mail-index.netbsd.org/tech-kern/2016/08/09/msg020963.html and check if you can still see the problem? Thanks, -- t-hash

[patch] xhci patch 20160809

2016-08-09 Thread Takahiro Hayashi
Hello, I'll post xhci patches for HEAD. x-addrendian.diff + Fix endian issue of device address. x-linktrb2.diff + Put Link TRB always at the end of ring. Should fix ctrl xfer problem on Intel xHC. Thanks, -- t-hash --- sys/dev/usb/xhci.c.orig 2016-07-18

Re: nick-nhusb merge coming soon

2016-04-17 Thread Takahiro Hayashi
On 2016/04/14 18:29, Takahiro Hayashi wrote: On 2016/04/14 17:40, Nick Hudson wrote: I summarise known problems: + KASSERT(sc->sc_command_addr == 0) in xhci_do_command() may fail. + My ASM1042 card does not work at all. No interrupts. It works on FreeBSD and OpenBSD. h

Re: nick-nhusb merge coming soon

2016-04-14 Thread Takahiro Hayashi
On 2016/04/14 17:40, Nick Hudson wrote: I summarise known problems: + KASSERT(sc->sc_command_addr == 0) in xhci_do_command() may fail. + My ASM1042 card does not work at all. No interrupts. It works on FreeBSD and OpenBSD.

Re: nick-nhusb merge coming soon

2016-04-14 Thread Takahiro Hayashi
h has come with the patches from Takahiro HAYASHI. xhci(4) still needs quite a bit of love to be fully ready. xhci(4) is still imcomplete and experimental. It needs more work. I summarise known problems: + KASSERT(sc->sc_command_addr == 0) in xhci_do_command() may fail. + My ASM1042 card does no

[patch] xhci patch 20151021

2015-10-21 Thread Takahiro Hayashi
Hello, Here are xhci patches for nick-nhusb branch. nhusb-xhci-cos.diff + Cosmetic: remove space after unary operator ~. nhusb-xhci-psfix.diff + Fix the bug that port feature UHF_PORT_{U1,U2}_TIMEOUT were never set. PS_SPEED bits were always cleared.

[patch] xhci patch 20150923

2015-09-23 Thread Takahiro Hayashi
Hello, Here are xhci patches for nick-nhusb branch. nhusb-xhcireg_h.diff + Fix the name of multiple inclusion protection. nhusb-uhub_c.diff + Fix devices were not recognized at boot on some xhci (AFAIK Intel PCHs). -- t-hash --- sys/dev/usb/xhcireg.h.orig

Re: [patch] xhci patch 20150911

2015-09-13 Thread Takahiro Hayashi
Hello, On 2015/09/13 18:28, Nick Hudson wrote: On 09/11/15 11:07, Takahiro Hayashi wrote: Hello, Here is xhci patches for nick-nhusb branch. nhusb-xhci-lock.diff + Fix lock error. Same as https://mail-index.netbsd.org/tech-kern/2015/07/15/msg019170.html nhusb-xhci-evh.diff + Split

[patch] xhci patch 20150911

2015-09-11 Thread Takahiro Hayashi
Hello, Here is xhci patches for nick-nhusb branch. nhusb-xhci-lock.diff + Fix lock error. Same as https://mail-index.netbsd.org/tech-kern/2015/07/15/msg019170.html nhusb-xhci-evh.diff + Split xhci_handle_event() into 3 functions. Whitespace. nhusb-xhci-evh2.diff

[patch] xhci patch 20150827

2015-08-28 Thread Takahiro Hayashi
Hello, Here is xhci patch for nick-nhusb branch. sys/dev/usb/xhci.c sys/dev/usb/xhcivar.h sys/dev/pci/xhci_pci.c + Use usbd_xfer_isread(). + Change mutex to be initialized at IPL_USB. + Add vendor init/portsc hook. + Modify xhci_trb_put() to take host byte order

Re: xhci patch 20150623

2015-07-15 Thread takahiro hayashi
Hello, I fixed a bug that xhci_close_pipe caused mutex lock error as close method is called with sc_lock held. --- src/sys/dev/usb/xhci.c.orig 2015-06-27 01:08:34.0 +0900 +++ src/sys/dev/usb/xhci.c 2015-07-15 05:20:26.0 +0900 @@ -1583,7 +1583,7 @@ xhci_close_pipe(struct

Re: xhci patch 20150623

2015-06-24 Thread takahiro hayashi
On 2015/06/24 07:17, takahiro hayashi wrote: On 2015/06/23 17:01, takahiro hayashi wrote: Hi, On 2015/06/23 16:12, Nick Hudson wrote: On 06/23/15 07:43, takahiro hayashi wrote: [snip] + USB keyboard interaction is laggy and annoying. Any idea why keyboard is laggy? Currently I'm

xhci patch 20150623

2015-06-23 Thread takahiro hayashi
Hello, Here is xhci patch for nick-nhusb branch. nh-xhci-check.diff + Add port range check in xhci_rhpsc(). + Add sanity check if xfer-ux_pipe != NULL in xhci_handle_event(). nh-xhci-prc.diff + Remove SET_FEATURE C_PORT_RESET(PRC) -- what would happen?

Re: xhci patch 20150623

2015-06-23 Thread takahiro hayashi
Hi, On 2015/06/23 16:12, Nick Hudson wrote: On 06/23/15 07:43, takahiro hayashi wrote: Hello, Here is xhci patch for nick-nhusb branch. nh-xhci-check.diff + Add port range check in xhci_rhpsc(). + Add sanity check if xfer-ux_pipe != NULL in xhci_handle_event(). nh-xhci-prc.diff

Re: xhci patch 20150623

2015-06-23 Thread takahiro hayashi
On 2015/06/23 17:01, takahiro hayashi wrote: Hi, On 2015/06/23 16:12, Nick Hudson wrote: On 06/23/15 07:43, takahiro hayashi wrote: [snip] + USB keyboard interaction is laggy and annoying. Any idea why keyboard is laggy? Currently I'm not sure. Something is wrong with interval value

Re: usbd_do_request_flags_pipe diagnostic panic

2015-06-07 Thread takahiro hayashi
Hi, On 2015/06/07 19:50, Nick Hudson wrote: On 06/06/15 05:39, takahiro hayashi wrote: Hello, On nick-nhusb branch kernel panics in usbd_transfer() when the zero-length request gets stalled. This happens when the uhidev driver issues usbd_set_idle to my USB keyboard, one of its uhidevs

Re: xhci patch 20150606

2015-06-07 Thread takahiro hayashi
Hi, On 2015/06/07 17:05, Nick Hudson wrote: On 06/06/15 18:51, takahiro hayashi wrote: On 2015/06/07 01:51, takahiro hayashi wrote: On 2015/06/07 01:39, Nick Hudson wrote: I don't think XHCI_* defines should appear in usb.h. Oh that's my fault. I'll fix it... New diff of usb.h attached

Re: xhci patch 20150606

2015-06-06 Thread takahiro hayashi
Hi, On 2015/06/07 01:39, Nick Hudson wrote: On 06/06/15 06:20, takahiro hayashi wrote: Hi, I've committed most of the diffs. Thank you for applying my patch! Just nh-ssp.dif, I think... --- src/sys/dev/usb/usb.h.orig2015-05-28 15:54:12.0 +0900 +++ src/sys/dev/usb/usb.h

Re: xhci patch 20150606

2015-06-06 Thread takahiro hayashi
On 2015/06/07 01:51, takahiro hayashi wrote: On 2015/06/07 01:39, Nick Hudson wrote: I don't think XHCI_* defines should appear in usb.h. Oh that's my fault. I'll fix it... New diff of usb.h attached. -- t-hash --- src/sys/dev/usb/usb.h.orig 2015-05-28 15:54:12.0 +0900 +++ src

usbd_do_request_flags_pipe diagnostic panic

2015-06-05 Thread takahiro hayashi
Hello, On nick-nhusb branch kernel panics in usbd_transfer() when the zero-length request gets stalled. This happens when the uhidev driver issues usbd_set_idle to my USB keyboard, one of its uhidevs returns stall for SET_IDLE request. While usbd_do_request_flags_pipe() processes the xfer for

xhci patch 20150606

2015-06-05 Thread takahiro hayashi
Hello, Here are xhci patches of some fixes, comments, and adding functions. --- nh-usb_subr-ss.diff + Use macro to check speed. Forgotten in privious patch. nh-xhcireg-maxintr.diff + Fix num of Max Interrupters to 11 bits width. nh-uhub-wrc.diff + Simplify

xhci current status

2015-05-31 Thread takahiro hayashi
Hello, Thanks to Nick, my xhci patches has been applied to nick-nhusb branch. I summarise current problems I found. Some of them are ongoing to solve, about some of them I have no idea why they happen. -- + HS hub in 3.0 hub under 3.0 port is disconnected and reconnected every several

xhci patch for nick-nhusb branch

2015-05-26 Thread takahiro hayashi
Hello, Here are some xhci patches for nick-nhusb branch. nh-xhci-cos.diff + Add comments. Some cosmetic changes. nh-xhci-clearhalt.diff + Don't abuse pipe-up_async_task for xhci_clear_endpoint_stall_async_task. Add member struct usb_task xp_async_task to

Re: patch: 3.0 hub support for xhci

2015-04-05 Thread Takahiro HAYASHI
Hello, On 2015/04/02 21:10, Nick Hudson wrote: On 03/24/15 13:30, Robert Sprowson wrote: b) some experimental USB 3 work that might break it for some people, this should probably be on a private branch I'm happy to do this on my nick-nhusb branch, but maybe this isn't what you want.

Re: patch: 3.0 hub support for xhci

2014-11-18 Thread Takahiro HAYASHI
Hello, On 11/18/14 19:21, Nick Hudson wrote: On 10/31/14 03:59, Takahiro HAYASHI wrote: hello, This patch tries to support 3.0 hubs for xhci. still xhci is at best experimental. Thanks for working on this. Are you tracking other BSDs? I retrieve FreeBSD, OpenBSD, and Linux src but not so

Re: patch: 3.0 hub support for xhci

2014-11-18 Thread Takahiro HAYASHI
Hello, This patch tries to support USB 3.0 for xhci. xhci is still at best experimental. Don't use it on production servers even though it looks work well. Fixes: - USB hubs should work. - The root hub of xhci is now changed to have separated SS and HS ports, so that SS and HS hubs in 3.0

patch: 3.0 hub support for xhci

2014-10-31 Thread Takahiro HAYASHI
hello, This patch tries to support 3.0 hubs for xhci. still xhci is at best experimental. Fixes: - USB hubs should work. - The root hub of xhci is now changed to have separated SS and HS ports, so that SS and HS hubs in 3.0 hub are hung from SS and HS roothub port respectively. - Fix

Re: Help: USB 3.0 xHCI driver does not support non-root hub

2014-10-13 Thread Takahiro HAYASHI
On 10/12/14 12:34, I wrote: - 3.0 hub should work, but either HS hub or SS hub in 3.0 hub may not be recognised. It looks one of these simultaneous interrupts is lost. uhub_intr() drops latter interrupt while uhub is exploring (sc_explorepending=1) for devices of former interrupt. I

Re: Help: USB 3.0 xHCI driver does not support non-root hub

2014-10-12 Thread Takahiro HAYASHI
Hello, I think 3.0 hub should work with this patch, but either HS hub or SS hub in 3.0 hub may not be recognised. still xhci is at best experimental. Fixes: - Fix incorrect route string was set. Correct route string does not contain root hub port. - Fix FS and LS devices were not

Re: Help: USB 3.0 xHCI driver does not support non-root hub

2014-10-03 Thread Takahiro HAYASHI
hi, On 09/15/14 23:46, Ryo ONODERA wrote: Hi, Our xHCI USB 3.0 driver with Intel Lynx Point/Lynx Point-LP, Renesas uPD70202 and Fresco Logic 0x1b73/0x1100 xHCI chips does not support non-root hub as following. I believe our xHCI driver have no non-root hub support. I have tested some USB

patch: verbose debug code for xhci

2014-09-19 Thread Takahiro HAYASHI
Hello, This patch does NOT improve xhci.c at all but may (or not) help people who try to read debugging hexdump even though they are not familiar with it. This patch is imcomplete, buggy, and does not support all requests. For example, you can read TRB values in human-readable form like this:

patch: xhci: return error if configure ep fails

2014-08-15 Thread Takahiro HAYASHI
Hello, This patch makes xhci_open return error code if xhci_configure_endpoint fails, then, makes umass comfortable if CONFIGURE_EP fails with TRB_ERROR_PARAMETER when 3.0 usb drive is connected and umass tries to open bulk-in/out endpoints. I have no idea why configure endpoint fails on only my

Re: USB 3.0 xhci questions

2014-08-13 Thread Takahiro HAYASHI
On 08/14/14 07:20, Ryo ONODERA wrote: Hi, From: Takahiro HAYASHI t.hash...@gmail.com, Date: Tue, 12 Aug 2014 02:14:43 +0900 For comparison here is dmesg from my testbed: xhci0 at pci5 dev 0 function 0: vendor 0x1033 product 0x0194 (rev. 0x04) xhci0: interrupting at ioapic0 pin 21 xhci_init

Re: Patch: xhci controller driver improvements

2014-08-12 Thread Takahiro HAYASHI
On 08/12/14 07:45, Takahiro HAYASHI wrote: Please send diff :) Wait for a while plz. lessprf.diff replaces most of device_printf. I define new macros DPRINTD and DPRINTDF. former prints args with device_xname(sc-sc_dev), latter prints args with device name and function name. I'll

Re: USB 3.0 xhci questions

2014-08-12 Thread Takahiro HAYASHI
On 08/12/14 20:37, Ryo ONODERA wrote: From: Takahiro HAYASHI t.hash...@gmail.com, Date: Tue, 12 Aug 2014 02:14:43 +0900 [snip] I have some questions. 1) Do you have PCI_INTR_FIXUP in your kernel config? I had no PCI_INTR_FIXUP in kernel config. I have added PCI_INTR_FIXUP to my kernel

Re: Patch: xhci controller driver improvements

2014-08-12 Thread Takahiro HAYASHI
On 08/12/14 23:07, Nick Hudson wrote: On 08/12/14 10:42, Takahiro HAYASHI wrote: On 08/12/14 07:45, Takahiro HAYASHI wrote: Please send diff :) Wait for a while plz. lessprf.diff replaces most of device_printf. I define new macros DPRINTD and DPRINTDF. former prints args

Re: USB 3.0 xhci questions

2014-08-11 Thread Takahiro HAYASHI
Hello, On 08/10/14 22:44, Ryo ONODERA wrote: Sadly, if my guess (1) was true, my MacBook Air' and Lenovo ThinkStation E32's USB 3.0 does not work. No device is detected. Do these xHCIs work on other OS? If yes, hardware seems good. -- t-hash

Re: USB 3.0 xhci questions

2014-08-11 Thread Takahiro HAYASHI
Hello, On 08/11/14 21:51, Ryo ONODERA wrote: Do these xHCIs work on other OS? If yes, hardware seems good. Arch Linux (archlinux-2014.08.01.iso; Linux 3.15.7) works fine on both machines. SuperSpeed USB device is detected and attached to xhci. Hardwares have no problem. Thanks for checking.

Re: Patch: xhci controller driver improvements

2014-08-11 Thread Takahiro HAYASHI
On 08/11/14 19:40, Nick Hudson wrote: @@ -2889,6 +3028,7 @@ xhci_timeout(void *addr) struct xhci_softc * const sc = xfer-pipe-device-bus-hci_private; if (sc-sc_dying) { +xhci_abort_xfer(xfer, USBD_TIMEOUT); return; } This looks very strange. Does it need

Re: Patch: xhci controller driver improvements

2014-08-10 Thread Takahiro HAYASHI
Hi, On 08/10/14 17:06, Nick Hudson wrote: Some comments... --- src/sys/dev/usb/xhci.c.orig2014-08-05 22:24:27.0 +0900 +++ src/sys/dev/usb/xhci.c2014-08-07 17:35:16.0 +0900 @@ -55,6 +55,8 @@ __KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.2 #include dev/usb/xhcivar.h #include

Re: Patch: xhci controller driver improvements

2014-08-09 Thread Takahiro HAYASHI
Hello, (05/11/14 02:57), Rajasekhar Pulluru wrote: Hi, The attached patch addresses following points. - With some usb devices, often some endpoints gets stalled. Resetting the endpoint helps recover usb transactions. - When a usb device is removed while data is being copied to/from, all the

Re: Patch: xhci controller driver improvements

2014-08-09 Thread Takahiro HAYASHI
On 08/10/14 12:31, matthew green wrote: i didn't look too closely, but this: +#include uvm/uvm.h /* for vtophys on arm */ should probably be uvm_extern.h. I see, thank you. -- t-hash