usb/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Alexandre Kovalenko

Number: 180726
Category:   usb
Synopsis:   XHCI umass support breaks between r248085 and r252560 on 
9-STABLE
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:   Sun Jul 21 19:10:00 UTC 2013
Closed-Date:
Last-Modified:
Originator: Alexandre Kovalenko
Release:9-STABLE
Organization:
Environment:
FreeBSD twinhead 9.2-BETA1 FreeBSD 9.2-BETA1 #11 r248085:253503: Sun Jul 21 
14:29:42 EDT 2013 root@twinhead:/usr/obj/usr/src/sys/TWINHEAD  amd64
Description:

 Three different external hard drives (Seagate, Western Digital and noname USB 
3.0 enclosure) refused to be recognized as the umass devices. Reverting 
/usr/src/sys/dev/bsd/controller to r248085, building and loading just xhci 
module makes drives appear again. Below are snippets from the log in both cases:
 
 Non working:
 
 Jul  4 14:35:17 twinhead kernel: xhci0: XHCI (generic) USB 3.0 controller 
mem 0xfddfe000-0xfddf irq 16 at device 0.0 on pci2
 Jul  4 14:35:17 twinhead kernel: xhci0: 64 byte context size.
 Jul  4 14:35:17 twinhead kernel: usbus0 on xhci0
 Jul  4 14:35:17 twinhead kernel: usbus0: 5.0Gbps Super Speed USB v3.0
 Jul  4 14:35:17 twinhead kernel: ugen0.1: 0x1912 at usbus0
 Jul  4 14:35:17 twinhead kernel: uhub0: 0x1912 XHCI root HUB, class 9/0, rev 
3.00/1.00, addr 1 on usbus0
 Jul  4 14:35:17 twinhead kernel: uhub0: 8 ports with 8 removable, self powered
 Jul  4 14:35:24 twinhead kernel: ugen0.2: ASMedia at usbus0
 Jul  4 14:35:24 twinhead kernel: umass0: ASMedia AS2105, class 0/0, rev 
3.00/0.01, addr 1 on usbus0
 Jul  4 14:35:29 twinhead kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 
00 00 00 24 00 
 Jul  4 14:35:29 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: CCB 
request completed with an error
 Jul  4 14:35:29 twinhead kernel: (probe0:umass-sim0:0:0:0): Retrying command
 Jul  4 14:35:30 twinhead kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 
00 00 00 24 00 
 Jul  4 14:35:30 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: CCB 
request completed with an error
 Jul  4 14:35:30 twinhead kernel: (probe0:umass-sim0:0:0:0): Retrying command
 Jul  4 14:35:35 twinhead kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 
00 00 00 24 00 
 Jul  4 14:35:35 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: CCB 
request completed with an error
 Jul  4 14:35:35 twinhead kernel: (probe0:umass-sim0:0:0:0): Retrying command
 Jul  4 14:35:36 twinhead kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 
00 00 00 24 00 
 Jul  4 14:35:36 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: CCB 
request completed with an error
 Jul  4 14:35:36 twinhead kernel: (probe0:umass-sim0:0:0:0): Retrying command
 Jul  4 14:35:41 twinhead kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 
00 00 00 24 00 
 Jul  4 14:35:41 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: CCB 
request completed with an error
 Jul  4 14:35:41 twinhead kernel: (probe0:umass-sim0:0:0:0): Error 5, Retries 
exhausted
 
 Working:
 
 Jul  4 14:40:20 twinhead kernel: ugen0.2: ASMedia at usbus0 (disconnected)
 Jul  4 14:40:20 twinhead kernel: umass0: at uhub0, port 2, addr 1 
(disconnected)
 Jul  4 14:40:27 twinhead kernel: ugen0.2: vendor 0x174c at usbus0
 Jul  4 14:40:27 twinhead kernel: umass0: vendor 0x174c product 0x5106, class 
0/0, rev 3.00/0.01, addr 1 on usbus0
 Jul  4 14:40:27 twinhead kernel: (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: 
a0 00 00 00 00 00 00 00 00 10 00 00 
 Jul  4 14:40:27 twinhead kernel: (probe0:umass-sim0:0:0:0): CAM status: SCSI 
Status Error
 Jul  4 14:40:27 twinhead kernel: (probe0:umass-sim0:0:0:0): SCSI status: Check 
Condition
 Jul  4 14:40:27 twinhead kernel: (probe0:umass-sim0:0:0:0): SCSI sense: 
ILLEGAL REQUEST asc:20,0 (Invalid command operation code)
 Jul  4 14:40:27 twinhead kernel: (probe0:umass-sim0:0:0:0): Error 22, 
Unretryable error
 Jul  4 14:40:27 twinhead kernel: da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
 Jul  4 14:40:27 twinhead kernel: da0: Hitachi HTS542520K9SA00 BBDO Fixed 
Direct Access SCSI-5 device 
 Jul  4 14:40:27 twinhead kernel: da0: 400.000MB/s transfers
 Jul  4 14:40:27 twinhead kernel: da0: 190782MB (390721968 512 byte sectors: 
255H 63S/T 24321C)
 Jul  4 14:40:27 twinhead kernel: da0: quirks=0x2NO_6_BYTE

How-To-Repeat:
Plug USB 3.0 mass storage and observe results.
Fix:
Roll back /usr/src/sys/dev/usb/controller directory to r248085.

Release-Note:
Audit-Trail:
Unformatted:
___
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/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Hans Petter Selasky

On 07/21/13 21:06, Alexandre Kovalenko wrote:



Number: 180726
Category:   usb
Synopsis:   XHCI umass support breaks between r248085 and r252560 on 
9-STABLE
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:   Sun Jul 21 19:10:00 UTC 2013
Closed-Date:
Last-Modified:
Originator: Alexandre Kovalenko
Release:9-STABLE
Organization:
Environment:

FreeBSD twinhead 9.2-BETA1 FreeBSD 9.2-BETA1 #11 r248085:253503: Sun Jul 21 
14:29:42 EDT 2013 root@twinhead:/usr/obj/usr/src/sys/TWINHEAD  amd64

Description:


  Three different external hard drives (Seagate, Western Digital and noname USB 
3.0 enclosure) refused to be recognized as the umass devices. Reverting 
/usr/src/sys/dev/bsd/controller to r248085, building and loading just xhci 
module makes drives appear again. Below are snippets from the log in both cases:



Can you try:

1) Attached patch.

2) Non ASMedia USB 3.0 controller

--HPS

diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index e6d5865..7070ef7 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -1654,7 +1654,7 @@ restart:
 			/* fill out buffer pointers */
 
 			if (average == 0) {
-npkt = 0;
+npkt = 1;
 memset(buf_res, 0, sizeof(buf_res));
 			} else {
 usbd_get_page(temp-pc, temp-offset +
@@ -1691,9 +1691,7 @@ restart:
 
 			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) {
@@ -1728,10 +1726,8 @@ restart:
 	dword |= XHCI_TRB_3_DIR_IN;
 break;
 			default:	/* XHCI_TRB_TYPE_NORMAL */
-/* BEI: Interrupts are inhibited until EOT */
 dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT |
 XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) |
-XHCI_TRB_3_BEI_BIT |
 XHCI_TRB_3_TBC_SET(temp-tbc) |
 XHCI_TRB_3_TLBPC_SET(temp-tlbpc);
 if (temp-direction == UE_DIR_IN)
___
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/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Alexandre Kovalenko
On Jul 21, 2013, at 3:32 PM, Hans Petter Selasky h...@bitfrost.no wrote:

 On 07/21/13 21:06, Alexandre Kovalenko wrote:
 
 Number: 180726
 Category:   usb
 Synopsis:   XHCI umass support breaks between r248085 and r252560 on 
 9-STABLE
 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:   Sun Jul 21 19:10:00 UTC 2013
 Closed-Date:
 Last-Modified:
 Originator: Alexandre Kovalenko
 Release:9-STABLE
 Organization:
 Environment:
 FreeBSD twinhead 9.2-BETA1 FreeBSD 9.2-BETA1 #11 r248085:253503: Sun Jul 21 
 14:29:42 EDT 2013 root@twinhead:/usr/obj/usr/src/sys/TWINHEAD  amd64
 Description:
 
  Three different external hard drives (Seagate, Western Digital and noname 
 USB 3.0 enclosure) refused to be recognized as the umass devices. Reverting 
 /usr/src/sys/dev/bsd/controller to r248085, building and loading just xhci 
 module makes drives appear again. Below are snippets from the log in both 
 cases:
 
 
 Can you try:
 
 1) Attached patch.
 
 2) Non ASMedia USB 3.0 controller
 
 --HPS
   
 xhci.diff

1) I will try to apply this patch on top of 253503. Let me know if I need to 
revert to the earlier rev -- that would take a little bit more time.

2) ASMedia is not a USB 3.0 controller -- it is one of three umass devices I 
was doing testing with (USB-to-SATA enclosure). The other two devices are made 
by Seagate and Western Digital. The USB controller is

xhci0@pci0:2:0:0:   class=0x0c0330 card=0x chip=0x00141912 rev=0x03 
hdr=0x00
vendor = 'Renesas Technology Corp.'
class  = serial bus
subclass   = USB

I can try to find different USB controller, but that would take some time.


Alexandre Sunny Kovalenko (Олександр Коваленко)

___
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/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Hans Petter Selasky

On 07/21/13 21:41, Alexandre Kovalenko wrote:

1) I will try to apply this patch on top of 253503. Let me know if I need to 
revert to the earlier rev -- that would take a little bit more time.


You don't need to revert. I'm on #bsdusb on EF-net.

--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/180726: commit references a PR

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

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/180726: commit references a PR
Date: Sun, 21 Jul 2013 20:45:32 + (UTC)

 Author: hselasky
 Date: Sun Jul 21 20:45:23 2013
 New Revision: 253532
 URL: http://svnweb.freebsd.org/changeset/base/253532
 
 Log:
   Fix an XHCI regression:
   
   The Block Event Interrupts, BEI, feature does not
   work like expected with the Renesas XHCI chipsets.
   Revert feature.
   
   While at it correct the TD SIZE computation in
   case of Zero Length Packet, ZLP, in the end of a
   multi frame USB transfer.
   
   MFC after:   1 week
   PR:  usb/180726
 
 Modified:
   head/sys/dev/usb/controller/xhci.c
 
 Modified: head/sys/dev/usb/controller/xhci.c
 ==
 --- head/sys/dev/usb/controller/xhci.c Sun Jul 21 19:44:53 2013
(r253531)
 +++ head/sys/dev/usb/controller/xhci.c Sun Jul 21 20:45:23 2013
(r253532)
 @@ -1682,7 +1682,6 @@ restart:
/* fill out buffer pointers */
  
if (average == 0) {
 -  npkt = 0;
memset(buf_res, 0, sizeof(buf_res));
} else {
usbd_get_page(temp-pc, temp-offset +
 @@ -1697,15 +1696,17 @@ restart:
buf_res.length = XHCI_TD_PAGE_SIZE;
  
npkt_off += buf_res.length;
 -
 -  /* setup npkt */
 -  npkt = (len_old - npkt_off + 
temp-max_packet_size - 1) /
 -  temp-max_packet_size;
 -
 -  if (npkt  31)
 -  npkt = 31;
}
  
 +  /* setup npkt */
 +  npkt = (len_old - npkt_off + temp-max_packet_size - 1) 
/
 +  temp-max_packet_size;
 +
 +  if (npkt == 0)
 +  npkt = 1;
 +  else if (npkt  31)
 +  npkt = 31;
 +
/* fill out TRB's */
td-td_trb[x].qwTrb0 =
htole64((uint64_t)buf_res.physaddr);
 @@ -1719,9 +1720,7 @@ restart:
  
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) {
 @@ -1756,10 +1755,8 @@ restart:
dword |= XHCI_TRB_3_DIR_IN;
break;
default:/* XHCI_TRB_TYPE_NORMAL */
 -  /* BEI: Interrupts are inhibited until EOT */
dword = XHCI_TRB_3_CHAIN_BIT | 
XHCI_TRB_3_CYCLE_BIT |
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) |
 -  XHCI_TRB_3_BEI_BIT |
XHCI_TRB_3_TBC_SET(temp-tbc) |
XHCI_TRB_3_TLBPC_SET(temp-tlbpc);
if (temp-direction == UE_DIR_IN)
 @@ -1838,6 +1835,7 @@ restart:
usb_pc_cpu_flush(td_first-page_cache);
}
  
 +  /* clear TD SIZE to zero, hence this is the last TRB */
/* remove chain bit because this is the last TRB in the chain */
td-td_trb[td-ntrb - 1].dwTrb2 = ~htole32(XHCI_TRB_2_TDSZ_SET(15));
td-td_trb[td-ntrb - 1].dwTrb3 = ~htole32(XHCI_TRB_3_CHAIN_BIT);
 ___
 svn-src-...@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
 
___
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/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Alexandre Kovalenko

On Jul 21, 2013, at 3:32 PM, Hans Petter Selasky h...@bitfrost.no wrote:

 On 07/21/13 21:06, Alexandre Kovalenko wrote:
 
 Number: 180726
 Category:   usb
 Synopsis:   XHCI umass support breaks between r248085 and r252560 on 
 9-STABLE
 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:   Sun Jul 21 19:10:00 UTC 2013
 Closed-Date:
 Last-Modified:
 Originator: Alexandre Kovalenko
 Release:9-STABLE
 Organization:
 Environment:
 FreeBSD twinhead 9.2-BETA1 FreeBSD 9.2-BETA1 #11 r248085:253503: Sun Jul 21 
 14:29:42 EDT 2013 root@twinhead:/usr/obj/usr/src/sys/TWINHEAD  amd64
 Description:
 
  Three different external hard drives (Seagate, Western Digital and noname 
 USB 3.0 enclosure) refused to be recognized as the umass devices. Reverting 
 /usr/src/sys/dev/bsd/controller to r248085, building and loading just xhci 
 module makes drives appear again. Below are snippets from the log in both 
 cases:
 
 
 Can you try:
 
 1) Attached patch.
 
 2) Non ASMedia USB 3.0 controller
 
 --HPS
   
 xhci.diff

After applying this patch 
(http://svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?view=patchr1=253532r2=253531pathrev=253532)
 on top of r253503 the life is good -- devices are recognized properly.

Thank you very much for your help.

Alexandre Sunny Kovalenko (Олександр Коваленко)


___
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/180726: XHCI umass support breaks between r248085 and r252560 on 9-STABLE

2013-07-21 Thread Alexandre Kovalenko
The following reply was made to PR usb/180726; it has been noted by GNATS.

From: Alexandre Kovalenko bsd.gai...@gmail.com
To: bug-follo...@freebsd.org,
 bsd.gai...@gmail.com
Cc:  
Subject: Re: usb/180726: XHCI umass support breaks between r248085 and r252560 
on 9-STABLE
Date: Sun, 21 Jul 2013 17:47:06 -0400

 --Apple-Mail=_6F6E3510-295E-4026-89ED-4A3E44C88E2A
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
charset=utf-8
 
 The patch =
 (http://svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?view=3D=
 patchr1=3D253532r2=3D253531pathrev=3D253532) fixes the issue for me, =
 so PR could be closed.
 
 Is it possible to include it into 9.2?
 
 Alexandre Sunny Kovalenko (=D0=9E=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=
 =B4=D1=80 =D0=9A=D0=BE=D0=B2=D0=B0=D0=BB=D0=B5=D0=BD=D0=BA=D0=BE)
 
 
 
 
 
 --Apple-Mail=_6F6E3510-295E-4026-89ED-4A3E44C88E2A
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/html;
charset=utf-8
 
 htmlheadmeta http-equiv=3DContent-Type content=3Dtext/html =
 charset=3Dutf-8/headbody style=3Dword-wrap: break-word; =
 -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; The =
 patch (a =
 href=3Dhttp://svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?=
 view=3Dpatchamp;r1=3D253532amp;r2=3D253531amp;pathrev=3D253532http://=
 svnweb.freebsd.org/base/head/sys/dev/usb/controller/xhci.c?view=3Dpatcham=
 p;r1=3D253532amp;r2=3D253531amp;pathrev=3D253532/a) fixes the issue =
 for me, so PR could be closed.divbr/divdivIs it possible to =
 include it into 9.2?/divdivbr/divdiv
 span class=3DApple-style-span style=3Dborder-collapse: separate; =
 color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; =
 font-variant: normal; font-weight: normal; letter-spacing: normal; =
 line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: =
 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: =
 0px; -webkit-border-horizontal-spacing: 0px; =
 -webkit-border-vertical-spacing: 0px; =
 -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; font-size: medium; span =
 class=3DApple-style-span style=3Dborder-collapse: separate; color: =
 rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
 normal; font-weight: normal; letter-spacing: normal; line-height: =
 normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
 text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
 -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
 auto; -webkit-text-stroke-width: 0px; font-size: medium; div =
 style=3Dword-wrap: break-word; -webkit-nbsp-mode: space; =
 -webkit-line-break: after-white-space; divAlexandre Sunny =
 Kovalenko (=D0=9E=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80 =
 =D0=9A=D0=BE=D0=B2=D0=B0=D0=BB=D0=B5=D0=BD=D0=BA=D0=BE)/divdivbr/di=
 v/div/spanbr class=3DApple-interchange-newline/spanbr =
 class=3DApple-interchange-newline
 /div
 br/body/html=
 
 --Apple-Mail=_6F6E3510-295E-4026-89ED-4A3E44C88E2A--
___
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