usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread takawata
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: takaw...@init-main.com
To: bug-follo...@freebsd.org, miguelmcl...@gmail.com, h...@bitfrost.no
Cc:  
Subject: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: 
Command timeout!)
Date: Fri, 07 Jun 2013 15:21:28 +0900

 Reverting the recent change on xhci.c fixes the problem for me.
 
 --- head/sys/dev/usb/controller/xhci.c  2013/04/23 06:26:54 249786
 +++ head/sys/dev/usb/controller/xhci.c  2013/06/02 12:28:29 251254
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Hans Petter Selasky
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Hans Petter Selasky h...@bitfrost.no
To: Miguel C. miguelmcl...@gmail.com
Cc: freebsd-gnats-sub...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand:
 Command timeout!)
Date: Fri, 07 Jun 2013 08:06:14 +0200

 This is a multi-part message in MIME format.
 --090608050403080409000203
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 On 06/05/13 21:05, Miguel C. wrote:
 
  Number: 179342
  Category:   usb
  Synopsis:   Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: 
  Command timeout!)
  Confidential:   no
  Severity:   non-critical
  Priority:   low
  Responsible:freebsd-usb
  State:  open
  Quarter:
  Keywords:
  Date-Required:
  Class:  sw-bug
  Submitter-Id:   current-users
  Arrival-Date:   Wed Jun 05 19:10:00 UTC 2013
  Closed-Date:
  Last-Modified:
  Originator: Miguel C.
  Release:
  Organization:
  Environment:
  % uname -a
  FreeBSD r2d2 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Mon May 13 00:54:58 UTC 
  2013 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
  Description:
  This is an Ultrabook (acer s3) with only one USB 3.0 Controller (2-ports)
 
  I first noticed that I could not install 10-current using the memstick 
  images, I got stuck at mount root, after upgrading form 9.1 using base and 
  kernel tarballs I noticed that the system has no longer detecting my 
  memsticks.
 
 
  When connecting usb devices (memstick,hdd) I get:
 
  xhci_do_comand: Command timeout!
  usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
  usbgen0.2: Unknown at usbus0 (disconnected)
  usb_reattach_port: could not allocate new device
 
 
  More info about the controller:
  xhci0: Intel Panther Point USB 3.0 controller mem 0xc050-0xc050 at 
  device 20.0 on pci0
 
  And has I explained in the mailling list, I already tried:
 
  sysctl hw.xhci.xhci_port_route=-1 (and =1) in /boot/loader.conf
  (and in sysctl.conf but I guess the first one is the proper way
 
  rebooted, and still no luck.
 
 
  How-To-Repeat:
  1: Download a memstick image and dd to a usb, after boot you get stuck at 
  mountroot prompt.
 
  2: If you're able to install 10-0 current any other way, just connect a USB 
  memstick to 3.0 controller, and you'll see the problem (unless if this is 
  related to my controller specifically - Intel Panther Point USB 3.0)
  Fix:
  Tried: sysctl hw.xhci.xhci_port_route=-1 - DID NOT work!
 
 
 Hi,
 
 Can you patch the kernel using the attached patch? It will fake 
 interrupts. Does the XHCI work now?
 
 --HPS
 
 
 --090608050403080409000203
 Content-Type: text/x-patch;
  name=xhci_timer.diff
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename=xhci_timer.diff
 
 === xhci.h
 ==
 --- xhci.h (revision 251258)
 +++ xhci.h (local)
 @@ -438,6 +438,8 @@
/* configure message */
struct usb_bus_msg  sc_config_msg[2];
  
 +  struct usb_callout  sc_callout;
 +
union xhci_hub_desc sc_hub_desc;
  
struct cv   sc_cmd_cv;
 === xhci_pci.c
 ==
 --- xhci_pci.c (revision 251258)
 +++ xhci_pci.c (local)
 @@ -132,6 +132,16 @@
}
  }
  
 +static void
 +xhci_timer(void *_sc)
 +{
 +  struct xhci_softc *sc = _sc;
 +  USB_BUS_UNLOCK(sc-sc_bus);
 +  xhci_interrupt(sc);
 +  USB_BUS_LOCK(sc-sc_bus);
 +  usb_callout_reset(sc-sc_callout, 1, (void *)xhci_timer, sc);
 +}
 +
  static int
  xhci_pci_attach(device_t self)
  {
 @@ -175,6 +185,12 @@
  
sprintf(sc-sc_vendor, 0x%04x, pci_get_vendor(self));
  
 +  usb_callout_init_mtx(sc-sc_callout, sc-sc_bus.bus_mtx, 0);
 +
 +  USB_BUS_LOCK(sc-sc_bus);
 +  xhci_timer(sc);
 +  USB_BUS_UNLOCK(sc-sc_bus);
 +
  #if (__FreeBSD_version = 700031)
err = bus_setup_intr(self, sc-sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)xhci_interrupt, sc, sc-sc_intr_hdl);
 
 --090608050403080409000203--
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Hans Petter Selasky
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Hans Petter Selasky h...@bitfrost.no
To: takaw...@init-main.com
Cc: bug-follo...@freebsd.org, miguelmcl...@gmail.com
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand:
 Command timeout!)
Date: Fri, 07 Jun 2013 08:49:14 +0200

 On 06/07/13 08:21, takaw...@init-main.com wrote:
  Reverting the recent change on xhci.c fixes the problem for me.
 
  --- head/sys/dev/usb/controller/xhci.c  2013/04/23 06:26:54 249786
  +++ head/sys/dev/usb/controller/xhci.c  2013/06/02 12:28:29 251254
 
 
 Hi,
 
 If you look at the SVN log, there are only a few changes in the XHCI 
 area. Could you identify exactly which change is the cause of the 
 problem? I don't see that any of the changes between r1 and r2 should 
 affect the XHCI device init function, where it is failing.
 
 http://svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?view=log
 
 xhci_do_comand: Command timeout!
 usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
 usbgen0.2: Unknown at usbus0 (disconnected)
 usb_reattach_port: could not allocate new device
 
 --HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Miguel Clara
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Miguel Clara miguelmcl...@gmail.com
To: Hans Petter Selasky h...@bitfrost.no
Cc: freebsd-gnats-sub...@freebsd.org, bug-follo...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working
 (xhci_do_comand: Command timeout!)
Date: Fri, 7 Jun 2013 13:44:39 +0100

 Hi,
 
 This patch does fix the issue (tested with different memsticks), I can
 now use usb drivers!
 
 I do see this at boot:
 ugen1.2: vendor 0x8087 at usbus1
 uhub4: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr
 2 on usbus1
 uhub4: 6 ports with 6 removable, self powered
 uhub3: 8 ports with 8 removable, self powered
 ugen1.3: Generic at usbus1
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 ugen0.2: Unknown at usbus0 (disconnected)
 uhub_reattach_port: could not allocate new device
 
 I guess its not related to the xhci problem, but another usb
 device but It tough I should mentioned it...
 
 Thanks
 
 On Fri, Jun 7, 2013 at 7:06 AM, Hans Petter Selasky h...@bitfrost.no wrote:
  On 06/05/13 21:05, Miguel C. wrote:
 
 
  Number: 179342
  Category:   usb
  Synopsis:   Freebsd 10.0-current USB 3.0 not working (xhci_do_comand:
  Command timeout!)
  Confidential:   no
  Severity:   non-critical
  Priority:   low
  Responsible:freebsd-usb
  State:  open
  Quarter:
  Keywords:
  Date-Required:
  Class:  sw-bug
  Submitter-Id:   current-users
  Arrival-Date:   Wed Jun 05 19:10:00 UTC 2013
  Closed-Date:
  Last-Modified:
  Originator: Miguel C.
  Release:
  Organization:
  Environment:
 
  % uname -a
  FreeBSD r2d2 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Mon May 13 00:54:58 UTC
  2013 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 
  Description:
 
  This is an Ultrabook (acer s3) with only one USB 3.0 Controller (2-ports)
 
  I first noticed that I could not install 10-current using the memstick
  images, I got stuck at mount root, after upgrading form 9.1 using base and
  kernel tarballs I noticed that the system has no longer detecting my
  memsticks.
 
 
  When connecting usb devices (memstick,hdd) I get:
 
  xhci_do_comand: Command timeout!
  usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
  usbgen0.2: Unknown at usbus0 (disconnected)
  usb_reattach_port: could not allocate new device
 
 
  More info about the controller:
  xhci0: Intel Panther Point USB 3.0 controller mem 0xc050-0xc050
  at device 20.0 on pci0
 
  And has I explained in the mailling list, I already tried:
 
  sysctl hw.xhci.xhci_port_route=-1 (and =1) in /boot/loader.conf
  (and in sysctl.conf but I guess the first one is the proper way
 
  rebooted, and still no luck.
 
 
  How-To-Repeat:
 
  1: Download a memstick image and dd to a usb, after boot you get stuck at
  mountroot prompt.
 
  2: If you're able to install 10-0 current any other way, just connect a
  USB memstick to 3.0 controller, and you'll see the problem (unless if this
  is related to my controller specifically - Intel Panther Point USB 3.0)
 
  Fix:
 
  Tried: sysctl hw.xhci.xhci_port_route=-1 - DID NOT work!
 
 
  Hi,
 
  Can you patch the kernel using the attached patch? It will fake interrupts.
  Does the XHCI work now?
 
  --HPS
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Miguel Clara
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Miguel Clara miguelmcl...@gmail.com
To: Hans Petter Selasky h...@bitfrost.no
Cc: freebsd-gnats-sub...@freebsd.org, bug-follo...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working
 (xhci_do_comand: Command timeout!)
Date: Fri, 7 Jun 2013 13:44:39 +0100

 Hi,
 
 This patch does fix the issue (tested with different memsticks), I can
 now use usb drivers!
 
 I do see this at boot:
 ugen1.2: vendor 0x8087 at usbus1
 uhub4: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr
 2 on usbus1
 uhub4: 6 ports with 6 removable, self powered
 uhub3: 8 ports with 8 removable, self powered
 ugen1.3: Generic at usbus1
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 usbd_setup_device_desc: getting device descriptor at addr 1 failed,
 USB_ERR_TIMEOUT
 ugen0.2: Unknown at usbus0 (disconnected)
 uhub_reattach_port: could not allocate new device
 
 I guess its not related to the xhci problem, but another usb
 device but It tough I should mentioned it...
 
 Thanks
 
 On Fri, Jun 7, 2013 at 7:06 AM, Hans Petter Selasky h...@bitfrost.no wrote:
  On 06/05/13 21:05, Miguel C. wrote:
 
 
  Number: 179342
  Category:   usb
  Synopsis:   Freebsd 10.0-current USB 3.0 not working (xhci_do_comand:
  Command timeout!)
  Confidential:   no
  Severity:   non-critical
  Priority:   low
  Responsible:freebsd-usb
  State:  open
  Quarter:
  Keywords:
  Date-Required:
  Class:  sw-bug
  Submitter-Id:   current-users
  Arrival-Date:   Wed Jun 05 19:10:00 UTC 2013
  Closed-Date:
  Last-Modified:
  Originator: Miguel C.
  Release:
  Organization:
  Environment:
 
  % uname -a
  FreeBSD r2d2 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Mon May 13 00:54:58 UTC
  2013 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 
  Description:
 
  This is an Ultrabook (acer s3) with only one USB 3.0 Controller (2-ports)
 
  I first noticed that I could not install 10-current using the memstick
  images, I got stuck at mount root, after upgrading form 9.1 using base and
  kernel tarballs I noticed that the system has no longer detecting my
  memsticks.
 
 
  When connecting usb devices (memstick,hdd) I get:
 
  xhci_do_comand: Command timeout!
  usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
  usbgen0.2: Unknown at usbus0 (disconnected)
  usb_reattach_port: could not allocate new device
 
 
  More info about the controller:
  xhci0: Intel Panther Point USB 3.0 controller mem 0xc050-0xc050
  at device 20.0 on pci0
 
  And has I explained in the mailling list, I already tried:
 
  sysctl hw.xhci.xhci_port_route=-1 (and =1) in /boot/loader.conf
  (and in sysctl.conf but I guess the first one is the proper way
 
  rebooted, and still no luck.
 
 
  How-To-Repeat:
 
  1: Download a memstick image and dd to a usb, after boot you get stuck at
  mountroot prompt.
 
  2: If you're able to install 10-0 current any other way, just connect a
  USB memstick to 3.0 controller, and you'll see the problem (unless if this
  is related to my controller specifically - Intel Panther Point USB 3.0)
 
  Fix:
 
  Tried: sysctl hw.xhci.xhci_port_route=-1 - DID NOT work!
 
 
  Hi,
 
  Can you patch the kernel using the attached patch? It will fake interrupts.
  Does the XHCI work now?
 
  --HPS
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Hans Petter Selasky
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Hans Petter Selasky h...@bitfrost.no
To: Miguel Clara miguelmcl...@gmail.com
Cc: freebsd-gnats-sub...@freebsd.org, bug-follo...@freebsd.org, 
 John Baldwin j...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand:
 Command timeout!)
Date: Fri, 07 Jun 2013 15:42:49 +0200

 On 06/07/13 14:44, Miguel Clara wrote:
  Hi,
 
  This patch does fix the issue (tested with different memsticks), I can
  now use usb drivers!
 
  I do see this at boot:
  ugen1.2: vendor 0x8087 at usbus1
  uhub4: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr
  2 on usbus1
 
 Hi,
 
 Thank you for testing. It tells med that the IRQ routing is broken 
 somewhere.
 
 Could you binary search the kernels between r249786 and r251254, to 
 figure out the exact commit that broke your XHCI driver, reverting my 
 patch? You should not need to build the kernel more than 10 times before 
 you figure out which has the commit which causes the failure.
 
 make buildkernel -j8 -DNO_CLEAN
 
 If you checked out the sources using GIT, this should be very quickly done.
 
 --HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Hans Petter Selasky
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Hans Petter Selasky h...@bitfrost.no
To: Miguel Clara miguelmcl...@gmail.com
Cc: freebsd-gnats-sub...@freebsd.org, bug-follo...@freebsd.org, 
 John Baldwin j...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand:
 Command timeout!)
Date: Fri, 07 Jun 2013 15:42:49 +0200

 On 06/07/13 14:44, Miguel Clara wrote:
  Hi,
 
  This patch does fix the issue (tested with different memsticks), I can
  now use usb drivers!
 
  I do see this at boot:
  ugen1.2: vendor 0x8087 at usbus1
  uhub4: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr
  2 on usbus1
 
 Hi,
 
 Thank you for testing. It tells med that the IRQ routing is broken 
 somewhere.
 
 Could you binary search the kernels between r249786 and r251254, to 
 figure out the exact commit that broke your XHCI driver, reverting my 
 patch? You should not need to build the kernel more than 10 times before 
 you figure out which has the commit which causes the failure.
 
 make buildkernel -j8 -DNO_CLEAN
 
 If you checked out the sources using GIT, this should be very quickly done.
 
 --HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: commit references a PR

2013-06-07 Thread dfilter service
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/179342: commit references a PR
Date: Fri,  7 Jun 2013 14:30:20 + (UTC)

 Author: hselasky
 Date: Fri Jun  7 14:30:06 2013
 New Revision: 251499
 URL: http://svnweb.freebsd.org/changeset/base/251499
 
 Log:
   Add support for polling the XHCI interrupt handler when
   the regular interrupt handler is not working properly or
   in case of MSI interrupts which are not yet supported.
   Remove interrupt setup code for FreeBSD versions older
   than 700031.
   
   MFC after:   1 week
   PR:  usb/179342
 
 Modified:
   head/sys/dev/usb/controller/xhci.c
   head/sys/dev/usb/controller/xhci.h
   head/sys/dev/usb/controller/xhci_pci.c
 
 Modified: head/sys/dev/usb/controller/xhci.c
 ==
 --- head/sys/dev/usb/controller/xhci.c Fri Jun  7 14:23:11 2013
(r251498)
 +++ head/sys/dev/usb/controller/xhci.c Fri Jun  7 14:30:06 2013
(r251499)
 @@ -90,6 +90,7 @@
  #ifdef USB_DEBUG
  static int xhcidebug;
  static int xhciroute;
 +static int xhcipolling;
  
  static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, USB XHCI);
  SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 @@ -98,6 +99,9 @@ TUNABLE_INT(hw.usb.xhci.debug, xhcide
  SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN,
  xhciroute, 0, Routing bitmap for switching EHCI ports to XHCI 
controller);
  TUNABLE_INT(hw.usb.xhci.xhci_port_route, xhciroute);
 +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN,
 +xhcipolling, 0, Set to enable software interrupt polling for XHCI 
controller);
 +TUNABLE_INT(hw.usb.xhci.use_polling, xhcipolling);
  #endif
  
  #define   XHCI_INTR_ENDPT 1
 @@ -194,6 +198,16 @@ xhci_get_port_route(void)
  #endif
  }
  
 +uint8_t
 +xhci_use_polling(void)
 +{
 +#ifdef USB_DEBUG
 +  return (xhcipolling != 0);
 +#else
 +  return (0);
 +#endif
 +}
 +
  static void
  xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
  {
 
 Modified: head/sys/dev/usb/controller/xhci.h
 ==
 --- head/sys/dev/usb/controller/xhci.h Fri Jun  7 14:23:11 2013
(r251498)
 +++ head/sys/dev/usb/controller/xhci.h Fri Jun  7 14:30:06 2013
(r251499)
 @@ -438,6 +438,8 @@ struct xhci_softc {
/* configure message */
struct usb_bus_msg  sc_config_msg[2];
  
 +  struct usb_callout  sc_callout;
 +
union xhci_hub_desc sc_hub_desc;
  
struct cv   sc_cmd_cv;
 @@ -500,6 +502,7 @@ struct xhci_softc {
  /* prototypes */
  
  uint32_t  xhci_get_port_route(void);
 +uint8_t   xhci_use_polling(void);
  usb_error_t xhci_halt_controller(struct xhci_softc *);
  usb_error_t xhci_init(struct xhci_softc *, device_t);
  usb_error_t xhci_start_controller(struct xhci_softc *);
 
 Modified: head/sys/dev/usb/controller/xhci_pci.c
 ==
 --- head/sys/dev/usb/controller/xhci_pci.c Fri Jun  7 14:23:11 2013
(r251498)
 +++ head/sys/dev/usb/controller/xhci_pci.c Fri Jun  7 14:30:06 2013
(r251499)
 @@ -132,6 +132,16 @@ xhci_pci_probe(device_t self)
}
  }
  
 +static void
 +xhci_interrupt_poll(void *_sc)
 +{
 +  struct xhci_softc *sc = _sc;
 +  USB_BUS_UNLOCK(sc-sc_bus);
 +  xhci_interrupt(sc);
 +  USB_BUS_LOCK(sc-sc_bus);
 +  usb_callout_reset(sc-sc_callout, 1, (void *)xhci_interrupt_poll, sc);
 +}
 +
  static int
  xhci_pci_attach(device_t self)
  {
 @@ -159,12 +169,13 @@ xhci_pci_attach(device_t self)
sc-sc_io_hdl = rman_get_bushandle(sc-sc_io_res);
sc-sc_io_size = rman_get_size(sc-sc_io_res);
  
 +  usb_callout_init_mtx(sc-sc_callout, sc-sc_bus.bus_mtx, 0);
 +
rid = 0;
sc-sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, rid,
RF_SHAREABLE | RF_ACTIVE);
if (sc-sc_irq_res == NULL) {
device_printf(self, Could not allocate IRQ\n);
 -  goto error;
}
sc-sc_bus.bdev = device_add_child(self, usbus, -1);
if (sc-sc_bus.bdev == NULL) {
 @@ -175,18 +186,22 @@ xhci_pci_attach(device_t self)
  
sprintf(sc-sc_vendor, 0x%04x, pci_get_vendor(self));
  
 -#if (__FreeBSD_version = 700031)
 -  err = bus_setup_intr(self, sc-sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
 -  NULL, (driver_intr_t *)xhci_interrupt, sc, sc-sc_intr_hdl);
 -#else
 -  err = bus_setup_intr(self, sc-sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
 -  (driver_intr_t *)xhci_interrupt, sc, sc-sc_intr_hdl);
 -#endif
 -  if (err) {
 -  device_printf(self, Could not setup IRQ, err=%d\n, err);
 -  sc-sc_intr_hdl = NULL;
 -  goto error;

Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread miguelmclara
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: miguelmcl...@gmail.com
To: Hans Petter Selasky h...@bitfrost.no
Cc: freebsd-gnats-sub...@freebsd.org,bug-follo...@freebsd.org,John Baldwin 
j...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand: Command timeout!)
Date: Fri, 7 Jun 2013 15:01:19 +

 DQpJIHVzZWQgc3ZuIGZvciBjaGVja291dCwgYnV0IHRoZSBwcmluY2lwbGUgSSB0aGUgc2FtZS4g
 SSB3aWxsIHRlc3QgZG9lcyBhbmQgcmVwb3J0IGJhY2sgbXkgZmluZGluZ3MuDQoNCg0KLS0tLS0t
 TWVuc2FnZW0gb3JpZ2luYWwtLS0tLS0NCkRlOkhhbnMgUGV0dGVyIFNlbGFza3kNClBhcmE6IE1p
 Z3VlbCBDbGFyYQ0KQ2M6IGZyZWVic2QtZ25hdHMtc3VibWl0QGZyZWVic2Qub3JnDQpDYzogYnVn
 LWZvbGxvd3VwQGZyZWVic2Qub3JnDQpDYzogSm9obiBCYWxkd2luDQpBc3N1bnRvOiBSZTogdXNi
 LzE3OTM0MjogRnJlZWJzZCAxMC4wLWN1cnJlbnQgVVNCIDMuMCBub3Qgd29ya2luZyAoeGhjaV9k
 b19jb21hbmQ6IENvbW1hbmQgdGltZW91dCEpDQpFbnZpYWRhOjcgSnVuIDIwMTMgMTQ6NDINCg0K
 T24gMDYvMDcvMTMgMTQ6NDQsIE1pZ3VlbCBDbGFyYSB3cm90ZToNCj4gSGksDQo+DQo+IFRoaXMg
 cGF0Y2ggZG9lcyBmaXggdGhlIGlzc3VlICh0ZXN0ZWQgd2l0aCBkaWZmZXJlbnQgbWVtc3RpY2tz
 KSwgSSBjYW4NCj4gbm93IHVzZSB1c2IgZHJpdmVycyENCj4NCj4gSSBkbyBzZWUgdGhpcyBhdCBi
 b290Og0KPiB1Z2VuMS4yOiA8dmVuZG9yIDB4ODA4Nz4gYXQgdXNidXMxDQo+IHVodWI0OiA8dmVu
 ZG9yIDB4ODA4NyBwcm9kdWN0IDB4MDAyNCwgY2xhc3MgOS8wLCByZXYgMi4wMC8wLjAwLCBhZGRy
 DQo+IDI+IG9uIHVzYnVzMQ0KDQpIaSwNCg0KVGhhbmsgeW91IGZvciB0ZXN0aW5nLiBJdCB0ZWxs
 cyBtZWQgdGhhdCB0aGUgSVJRIHJvdXRpbmcgaXMgYnJva2VuIA0Kc29tZXdoZXJlLg0KDQpDb3Vs
 ZCB5b3UgYmluYXJ5IHNlYXJjaCB0aGUga2VybmVscyBiZXR3ZWVuIHIyNDk3ODYgYW5kIHIyNTEy
 NTQsIHRvIA0KZmlndXJlIG91dCB0aGUgZXhhY3QgY29tbWl0IHRoYXQgYnJva2UgeW91ciBYSENJ
 IGRyaXZlciwgcmV2ZXJ0aW5nIG15IA0KcGF0Y2g/IFlvdSBzaG91bGQgbm90IG5lZWQgdG8gYnVp
 bGQgdGhlIGtlcm5lbCBtb3JlIHRoYW4gMTAgdGltZXMgYmVmb3JlIA0KeW91IGZpZ3VyZSBvdXQg
 d2hpY2ggaGFzIHRoZSBjb21taXQgd2hpY2ggY2F1c2VzIHRoZSBmYWlsdXJlLg0KDQptYWtlIGJ1
 aWxka2VybmVsIC1qOCAtRE5PX0NMRUFODQoNCklmIHlvdSBjaGVja2VkIG91dCB0aGUgc291cmNl
 cyB1c2luZyBHSVQsIHRoaXMgc2hvdWxkIGJlIHZlcnkgcXVpY2tseSBkb25lLg0KDQotLUhQUw0K
 DQoNCkVudmlhZG8gYSBwYXJ0aXIgZG8gbWV1IHNtYXJ0cGhvbmUgQmxhY2tCZXJyea4gd3d3LmJs
 YWNrYmVycnkuY29t
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread miguelmclara
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: miguelmcl...@gmail.com
To: Hans Petter Selasky h...@bitfrost.no
Cc: freebsd-gnats-sub...@freebsd.org,bug-follo...@freebsd.org,John Baldwin 
j...@freebsd.org
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand: Command timeout!)
Date: Fri, 7 Jun 2013 15:01:19 +

 DQpJIHVzZWQgc3ZuIGZvciBjaGVja291dCwgYnV0IHRoZSBwcmluY2lwbGUgSSB0aGUgc2FtZS4g
 SSB3aWxsIHRlc3QgZG9lcyBhbmQgcmVwb3J0IGJhY2sgbXkgZmluZGluZ3MuDQoNCg0KLS0tLS0t
 TWVuc2FnZW0gb3JpZ2luYWwtLS0tLS0NCkRlOkhhbnMgUGV0dGVyIFNlbGFza3kNClBhcmE6IE1p
 Z3VlbCBDbGFyYQ0KQ2M6IGZyZWVic2QtZ25hdHMtc3VibWl0QGZyZWVic2Qub3JnDQpDYzogYnVn
 LWZvbGxvd3VwQGZyZWVic2Qub3JnDQpDYzogSm9obiBCYWxkd2luDQpBc3N1bnRvOiBSZTogdXNi
 LzE3OTM0MjogRnJlZWJzZCAxMC4wLWN1cnJlbnQgVVNCIDMuMCBub3Qgd29ya2luZyAoeGhjaV9k
 b19jb21hbmQ6IENvbW1hbmQgdGltZW91dCEpDQpFbnZpYWRhOjcgSnVuIDIwMTMgMTQ6NDINCg0K
 T24gMDYvMDcvMTMgMTQ6NDQsIE1pZ3VlbCBDbGFyYSB3cm90ZToNCj4gSGksDQo+DQo+IFRoaXMg
 cGF0Y2ggZG9lcyBmaXggdGhlIGlzc3VlICh0ZXN0ZWQgd2l0aCBkaWZmZXJlbnQgbWVtc3RpY2tz
 KSwgSSBjYW4NCj4gbm93IHVzZSB1c2IgZHJpdmVycyENCj4NCj4gSSBkbyBzZWUgdGhpcyBhdCBi
 b290Og0KPiB1Z2VuMS4yOiA8dmVuZG9yIDB4ODA4Nz4gYXQgdXNidXMxDQo+IHVodWI0OiA8dmVu
 ZG9yIDB4ODA4NyBwcm9kdWN0IDB4MDAyNCwgY2xhc3MgOS8wLCByZXYgMi4wMC8wLjAwLCBhZGRy
 DQo+IDI+IG9uIHVzYnVzMQ0KDQpIaSwNCg0KVGhhbmsgeW91IGZvciB0ZXN0aW5nLiBJdCB0ZWxs
 cyBtZWQgdGhhdCB0aGUgSVJRIHJvdXRpbmcgaXMgYnJva2VuIA0Kc29tZXdoZXJlLg0KDQpDb3Vs
 ZCB5b3UgYmluYXJ5IHNlYXJjaCB0aGUga2VybmVscyBiZXR3ZWVuIHIyNDk3ODYgYW5kIHIyNTEy
 NTQsIHRvIA0KZmlndXJlIG91dCB0aGUgZXhhY3QgY29tbWl0IHRoYXQgYnJva2UgeW91ciBYSENJ
 IGRyaXZlciwgcmV2ZXJ0aW5nIG15IA0KcGF0Y2g/IFlvdSBzaG91bGQgbm90IG5lZWQgdG8gYnVp
 bGQgdGhlIGtlcm5lbCBtb3JlIHRoYW4gMTAgdGltZXMgYmVmb3JlIA0KeW91IGZpZ3VyZSBvdXQg
 d2hpY2ggaGFzIHRoZSBjb21taXQgd2hpY2ggY2F1c2VzIHRoZSBmYWlsdXJlLg0KDQptYWtlIGJ1
 aWxka2VybmVsIC1qOCAtRE5PX0NMRUFODQoNCklmIHlvdSBjaGVja2VkIG91dCB0aGUgc291cmNl
 cyB1c2luZyBHSVQsIHRoaXMgc2hvdWxkIGJlIHZlcnkgcXVpY2tseSBkb25lLg0KDQotLUhQUw0K
 DQoNCkVudmlhZG8gYSBwYXJ0aXIgZG8gbWV1IHNtYXJ0cGhvbmUgQmxhY2tCZXJyea4gd3d3LmJs
 YWNrYmVycnkuY29t
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Takanori Watanabe
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: Takanori Watanabe takaw...@init-main.com
To: Hans Petter Selasky h...@bitfrost.no
Cc: bug-follo...@freebsd.org, miguelmcl...@gmail.com
Subject: Re: usb/179342: Freebsd 10.0-current USB 3.0 not working 
(xhci_do_comand: Command timeout!)
Date: Sat, 08 Jun 2013 01:49:55 +0900

 In message 51b1826a.3000...@bitfrost.no, Hans Petter Selasky wrote:
 On 06/07/13 08:21, takaw...@init-main.com wrote:
  Reverting the recent change on xhci.c fixes the problem for me.
 
  --- head/sys/dev/usb/controller/xhci.c  2013/04/23 06:26:54 249786
  +++ head/sys/dev/usb/controller/xhci.c  2013/06/02 12:28:29 251254
 
 
 Hi,
 
 If you look at the SVN log, there are only a few changes in the XHCI 
 area. Could you identify exactly which change is the cause of the 
 problem? I don't see that any of the changes between r1 and r2 should 
 affect the XHCI device init function, where it is failing.
 
 http://svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?view=log
 
 xhci_do_comand: Command timeout!
 usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
 usbgen0.2: Unknown at usbus0 (disconnected)
 usb_reattach_port: could not allocate new device
 
 xhci.c 251251:251253 cause the problem for me.
 
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


RE: usb/179342: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command timeout!)

2013-06-07 Thread Hans Petter Selasky
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: =?utf-8?Q?Hans_Petter_Selasky?= hans.petter.sela...@bitfrost.no
To: =?utf-8?Q?Takanori_Watanabe?= takaw...@init-main.com
Cc: =?utf-8?Q?miguelmclara=40gmail=2Ecom?= miguelmcl...@gmail.com, 
 =?utf-8?Q?bug-followup=40FreeBSD=2Eorg?= bug-follo...@freebsd.org
Subject: RE: usb/179342: Freebsd 10.0-current USB 3.0 not working
 (xhci_do_comand: Command timeout!)
Date: Fri, 7 Jun 2013 19:47:21 +0200

 This is a multi-part message in MIME format. Your mail reader does not
 understand MIME message format.
 --=_FOxI0JVt0ros0tqh1HRVDjPZNCyIUdOP9Jp8wmtmxJ+R8R9K
 Content-Type: text/plain; charset=utf-8
 Content-Transfer-Encoding: quoted-printable
 
 Can you try:=0D=0A=0D=0A=C2=A0=0D=0Ar251252=0D=0A=0D=0A=C2=A0=0D=0Aaswell=
 , that`s a header file change adjusting the IRQ rate of the XHCI controll=
 er.=0D=0A=0D=0A=C2=A0=0D=0A--HPS=0D=0A=0D=0A-Original message-=0D=
 =0AFrom:Takanori Watanabe takaw...@init-main.com=0D=0ASent:Fri 07-06-20=
 13 18:55=0D=0ASubject:Re: usb/179342: Freebsd 10.0-current USB 3.0 not wo=
 rking (xhci_do_comand: Command timeout!)=0D=0ATo:Hans Petter Selasky han=
 s.petter.sela...@bitfrost.no;=20=0D=0ACC:bug-follo...@freebsd.org; migue=
 lmcl...@gmail.com;=20=0D=0AIn message 51b1826a.3000...@bitfrost.no, Han=
 s Petter Selasky wrote:=0D=0AOn 06/07/13 08:21, takaw...@init-main.com w=
 rote:=0D=0A Reverting the recent change on xhci.c fixes the problem for=
  me.=0D=0A=0D=0A --- head/sys/dev/usb/controller/xhci.c =C2=A02013/04=
 /23 06:26:54 =C2=A0 =C2=A0 249786=0D=0A +++ head/sys/dev/usb/controller=
 /xhci.c =C2=A02013/06/02 12:28:29 =C2=A0 =C2=A0 251254=0D=0A=0D=0A=0D=0A=
 Hi,=0D=0A=0D=0AIf you look at the SVN log, there are only a few change=
 s in the XHCI=20=0D=0Aarea. Could you identify exactly which change is t=
 he cause of the=20=0D=0Aproblem=3F I don't see that any of the changes b=
 etween r1 and r2 should=20=0D=0Aaffect the XHCI device init function, wh=
 ere it is failing.=0D=0A=0D=0Ahttp://svnweb.freebsd.org/base/head/sys/d=
 ev/usb/controller/xhci.c=3Fview=3Dlog=0D=0A=0D=0Axhci_do_comand: Comman=
 d timeout!=0D=0Ausb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT,=
  ignored)=0D=0Ausbgen0.2: Unknown at usbus0 (disconnected)=0D=0Ausb_r=
 eattach_port: could not allocate new device=0D=0A=0D=0Axhci.c 251251:2512=
 53 cause the problem for me.=0D=0A=0D=0A=0D=0A
 --=_FOxI0JVt0ros0tqh1HRVDjPZNCyIUdOP9Jp8wmtmxJ+R8R9K
 Content-Type: text/html; charset=utf-8
 Content-Transfer-Encoding: quoted-printable
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://ww=
 w.w3.org/TR/html4/loose.dtdhtml=0Ahead=0A  meta name=3DGenerator=
  content=3DZarafa WebAccess v7.1.0-36420=0A  meta http-equiv=3DConte=
 nt-Type content=3Dtext/html; charset=3Dutf-8=0A  titleRE: usb/17934=
 2: Freebsd 10.0-current USB 3.0 not working (xhci_do_comand: Command time=
 out!)/title=0A  style type=3Dtext/css=0A  body=0D=0A  {=0D=0A=
 font-family: Arial, Verdana, Sans-Serif ! important;=0D=0A   =
  font-size: 12px;=0D=0Apadding: 5px 5px 5px 5px;=0D=0Amar=
 gin: 0px;=0D=0Aborder-style: none;=0D=0Abackground-color:=
  #ff;=0D=0A  }=0D=0A=0D=0A  p, ul, li=0D=0A  {=0D=0A =
margin-top: 0px;=0D=0Amargin-bottom: 0px;=0D=0A  }=0D=0A  =
 /style=0A/head=0Abody=0ApCan you try:/ppnbsp;/ppr251252=
 /ppnbsp;/ppaswell, that`s a header file change adjusting the IRQ =
 rate of the XHCI controller./ppnbsp;/pp--HPS/pblockquote styl=
 e=3Dborder-left: 2px solid #325FBA; padding-left: 5px;margin-left:5px;=
 -Original message-br /strongFrom:/strong=09Takanori Watanab=
 e lt;takaw...@init-main.comgt;br /strongSent:/strong=09Fri 07-06-=
 2013 18:55br /strongSubject:/strong=09Re: usb/179342: Freebsd 10.0-=
 current USB 3.0 not working (xhci_do_comand: Command timeout!)br /stro=
 ngTo:/strong=09Hans Petter Selasky lt;hans.petter.sela...@bitfrost.no=
 gt;; br /strongCC:/strong=09bug-follo...@freebsd.org; miguelmclara=
 @gmail.com; br /In message lt;51b1826a.3000...@bitfrost.nogt;, Hans P=
 etter Selasky wrote:br /gt;On 06/07/13 08:21, takaw...@init-main.com w=
 rote:br /gt;gt; Reverting the recent change on xhci.c fixes the probl=
 em for me.br /gt;gt;br /gt;gt; --- head/sys/dev/usb/controller/xh=
 ci.c nbsp;2013/04/23 06:26:54 nbsp; nbsp; 249786br /gt;gt; +++ hea=
 d/sys/dev/usb/controller/xhci.c nbsp;2013/06/02 12:28:29 nbsp; nbsp; 2=
 51254br /gt;gt;br /gt;br /gt;Hi,br /gt;br /gt;If you look=
  at the SVN log, there are only a few changes in the XHCI br /gt;area.=
  Could you identify exactly which change is the cause of the br /gt;pr=
 oblem=3F I don#39;t see that any of the changes between r1 and r2 should=
  br /gt;affect the XHCI device init function, where it is failing.br =
 /gt;br /gt;http://svnweb.freebsd.org/base/head/sys/dev/usb/controlle=
 r/xhci.c=3Fview=3Dlogbr /gt;br /gt;xhci_do_comand: Command timeout!=
 br /gt;usb_alloc_device: 

Re: usb/179342: commit references a PR

2013-06-07 Thread dfilter service
The following reply was made to PR usb/179342; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/179342: commit references a PR
Date: Fri,  7 Jun 2013 22:36:05 + (UTC)

 Author: hselasky
 Date: Fri Jun  7 22:35:58 2013
 New Revision: 251515
 URL: http://svnweb.freebsd.org/changeset/base/251515
 
 Log:
   Fix some recent regression issues:
   
   1) Only multi-TD isochronous transfers should use NORMAL
   type after specific type as per XHCI specification.
   
   2) BEI bit is only available in NORMAL and ISOCHRONOUS
   TRB types. Don't use this bit for other types to avoid
   hardware asserts. Reserved bits should be don't care
   though ...
   
   MFC after:   1 week
   PR:  usb/179342
 
 Modified:
   head/sys/dev/usb/controller/xhci.c
 
 Modified: head/sys/dev/usb/controller/xhci.c
 ==
 --- head/sys/dev/usb/controller/xhci.c Fri Jun  7 22:01:06 2013
(r251514)
 +++ head/sys/dev/usb/controller/xhci.c Fri Jun  7 22:35:58 2013
(r251515)
 @@ -1561,6 +1561,7 @@ xhci_setup_generic_chain_sub(struct xhci
struct xhci_td *td;
struct xhci_td *td_next;
struct xhci_td *td_alt_next;
 +  struct xhci_td *td_first;
uint32_t buf_offset;
uint32_t average;
uint32_t len_old;
 @@ -1569,7 +1570,6 @@ xhci_setup_generic_chain_sub(struct xhci
uint8_t shortpkt_old;
uint8_t precompute;
uint8_t x;
 -  uint8_t first_trb = 1;
  
td_alt_next = NULL;
buf_offset = 0;
 @@ -1581,7 +1581,7 @@ xhci_setup_generic_chain_sub(struct xhci
  restart:
  
td = temp-td;
 -  td_next = temp-td_next;
 +  td_next = td_first = temp-td_next;
  
while (1) {
  
 @@ -1717,48 +1717,55 @@ restart:
  
td-td_trb[x].dwTrb2 = htole32(dword);
  
 -  /* BEI: Interrupts are inhibited until EOT */
 -  dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT |
 -XHCI_TRB_3_BEI_BIT |
 -XHCI_TRB_3_TBC_SET(temp-tbc) |
 -XHCI_TRB_3_TLBPC_SET(temp-tlbpc);
 -
 -  if (first_trb != 0) {
 -  first_trb = 0;
 -  dword |= XHCI_TRB_3_TYPE_SET(temp-trb_type);
 -  /*
 -   * Remove cycle bit from the first TRB
 -   * if we are stepping them:
 -   */
 -  if (temp-step_td != 0)
 -  dword = ~XHCI_TRB_3_CYCLE_BIT;
 -  } else {
 -  dword |= 
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL);
 -  }
 -  if (temp-trb_type == XHCI_TRB_TYPE_ISOCH) {
 -  if (temp-do_isoc_sync != 0) {
 +  switch (temp-trb_type) {
 +  case XHCI_TRB_TYPE_ISOCH:
 +  /* BEI: Interrupts are inhibited until EOT */
 +  dword = XHCI_TRB_3_CHAIN_BIT | 
XHCI_TRB_3_CYCLE_BIT |
 +  XHCI_TRB_3_BEI_BIT |
 +  XHCI_TRB_3_TBC_SET(temp-tbc) |
 +  XHCI_TRB_3_TLBPC_SET(temp-tlbpc);
 +  if (td != td_first) {
 +  dword |= 
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL);
 +  } else if (temp-do_isoc_sync != 0) {
temp-do_isoc_sync = 0;
 -  dword |= 
XHCI_TRB_3_FRID_SET(temp-isoc_frame / 8);
 +  /* wait until isoc_frame */
 +  dword |= 
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ISOCH) |
 +  
XHCI_TRB_3_FRID_SET(temp-isoc_frame / 8);
} else {
 -  dword |= XHCI_TRB_3_ISO_SIA_BIT;
 +  /* start data transfer at next interval 
*/
 +  dword |= 
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ISOCH) |
 +  XHCI_TRB_3_ISO_SIA_BIT;
}
 +  if (temp-direction == UE_DIR_IN)
 +  dword |= XHCI_TRB_3_DIR_IN | 
XHCI_TRB_3_ISP_BIT;
 +  break;
 +  case XHCI_TRB_TYPE_DATA_STAGE:
 +  dword = XHCI_TRB_3_CHAIN_BIT | 
XHCI_TRB_3_CYCLE_BIT |
 +  
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE) |
 +  XHCI_TRB_3_TBC_SET(temp-tbc) |
 +