Re: xhci data toggle out of sync

2022-04-21 Thread Hans Petter Selasky
On 4/21/22 17:15, Kumara N Babu wrote: Hi HPS, Thanks. Do you plan to MFC this change to stable/12 ? After we've debugged all the issues you are experiencing, yes. --HPS

Re: xhci data toggle out of sync

2022-04-21 Thread Hans Petter Selasky
Hi Mahesh, FYI: I've made the following commit for now: https://cgit.freebsd.org/src/commit/?id=cda31e734925346328fd2369585ab3f6767ec225 --HPS

Re: xhci data toggle out of sync

2022-04-21 Thread Hans Petter Selasky
On 4/21/22 10:23, Mahesh Vardhamanaiah wrote: Hi HPS, Hi Mahesh, With few debug logs I do see that xhci_configure_reset_endpoint:3958: epno = 3, ep_state = 3, drop = 0 xhci_configure_reset_endpoint:3958: epno = 3, ep_state = 0, drop = 1 Do we need to do drop even if the ep_state is 0 ?

Re: xhci data toggle out of sync

2022-04-20 Thread Hans Petter Selasky
Hi Mahesh, I don't see any "Could not XXX" messages, so then the XHCI part should be fine, and if you verify using Beagle, I expect there to be no more data toggle mismatches, but I may be wrong. --HPS On 4/20/22 19:48, Mahesh Vardhamanaiah wrote: Please find the few of the debug logs added

Re: xhci data toggle out of sync

2022-04-20 Thread Hans Petter Selasky
Hi, On 4/20/22 14:06, Mahesh Vardhamanaiah wrote: Is the fix like we get error for the Data transaction and report the error. Later we detect that EP is error and we reconfigured it ? There is an issue, an OUT transaction that doesn't get ACK'ed - right, and that is not a problem of the XHCI

RE: xhci data toggle out of sync

2022-04-20 Thread Mahesh Vardhamanaiah
, 2022 5:37 PM To: Hans Petter Selasky ; Kamal Prasad ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: RE: xhci data toggle out of sync Hi HPS, Please find the patch used and kernel booted. root@:RE:0% uname -a FreeBSD JNPR

RE: xhci data toggle out of sync

2022-04-20 Thread Mahesh Vardhamanaiah
Selasky Sent: Wednesday, April 20, 2022 5:20 PM To: Mahesh Vardhamanaiah ; Kamal Prasad ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/20/22 12

Re: xhci data toggle out of sync

2022-04-20 Thread Hans Petter Selasky
On 4/20/22 12:59, Mahesh Vardhamanaiah wrote: Hi HPS, Still no luck. I had added device_prints if the configure EP gets invoked and I don’t see them either during the error. login: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 aa f2 68 00 00 80 00 (da0:umass-sim0:0:0:0): CAM status: CCB requ

RE: xhci data toggle out of sync

2022-04-20 Thread Mahesh Vardhamanaiah
Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/20/22 07:15, Mahesh Vardhamanaiah wrote: > Hi HPS, > > The controller is from Broadcom (BCM56275 chip) so have created Support > Request Case for the

Re: xhci data toggle out of sync

2022-04-20 Thread Hans Petter Selasky
On 4/20/22 07:15, Mahesh Vardhamanaiah wrote: Hi HPS, The controller is from Broadcom (BCM56275 chip) so have created Support Request Case for the query below. Thanks, Mahesh Hi Mahesh, Here is one more patch you can try. Please revert all prior patches. --HPS diff --git a/sys/dev/usb/con

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/19/22 17:31, Mahesh Vardhamanaiah wrote: > Hi HPS, > > Sorry, my knowledge on US

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 17:31, Mahesh Vardhamanaiah wrote: Hi HPS, Sorry, my knowledge on USB is very limited. Is there any other way to reset the data toggles if the state Transition is not allowed ? Hi Mahesh, I will check the XHCI specification again, but I'm afraid we'll need to workaround this on

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
: Tuesday, April 19, 2022 7:03 PM To: Mahesh Vardhamanaiah ; Kamal Prasad ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] Hi Mahesh, The function

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
Hi Mahesh, The function xhci_cmd_reset_ep() is supposed to set the TX or RX data toggle back to zero for the endpoint context given by epno. Maybe you could investigate why that function is not working with your XHCI hardware? I feel you are quite competent in USB regards. Maybe the Linux U

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
Hi Mahesh, On 4/19/22 14:18, Mahesh Vardhamanaiah wrote: Hi HPS, I think there is some confusion the error I am printing is in HEX value so the decimal error code is USB_ERR_IOERROR,/* 18 */ Good catch. That IOERROR is hiding a hardware error code, maybe you could also prin

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
, April 19, 2022 5:15 PM To: Mahesh Vardhamanaiah ; Kamal Prasad ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/19/22 13:36, Mahesh

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 13:36, Mahesh Vardhamanaiah wrote: Hi HPS, Please find the diff below for the error prints. [maheshmv@svl-bsdx-02 /b/maheshmv/usb_issue/src]$ git diff sys/dev/usb/controller/xhci.c diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 70a73dcc94c..fa7c106

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
Prasad ; Mahesh Vardhamanaiah ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/19/22 12:59, Kamal Prasad wrote: > Hi Peter, > >&g

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 12:59, Kamal Prasad wrote: Hi Peter, Which is not a valid return code from xhci_do_command(). Can you check where this value comes from? This is coming from this location in xhci_configure_endpoint() which in turn is called by xhci_configure_endpoint_by_xfer():- ---

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
ibbits ; Kumara N Babu ; Kamal Prasad ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/19/22 11:30, Mahesh Vardhamanaiah wrote: > Hi HPS, > > The error seems to be NO_PIPE and end points are 2 & 3 b

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 11:30, Mahesh Vardhamanaiah wrote: Hi HPS, The error seems to be NO_PIPE and end points are 2 & 3 but the usbconfig dump_all_desc lists epaddress 1, 81 any idea why ? Hi, The XHCI endpoint context order is different from the endpoint numbers, so this is expected. ugen0.3: at

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 11:20, Mahesh Vardhamanaiah wrote: Hi HPS, Please find the requested logs. xhci0: MMV endpoint 3 state 2 xhci0: MMV Could not stop endpoint 3 err 12 xhci0: MMV endpoint 3 state 3 xhci0: MMV Could not stop endpoint 3 err 12 xhci0: MMV Could not reset endpoint 3 err 12 xhci0: MMV endpo

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
asad ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] Hi Mahesh, On 4/19/22 10:40, Mahesh Vardhamanaiah wrote: > xhci0: MMV Could not stop endpoint 3 > xhci0: MMV Could not reset endpoint 3 Is there a chance you can find o

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
Vardhamanaiah ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kamal Prasad ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] On 4/19/22 10:40, Mahesh Vardhamanaiah wrote: > xhci_get_endpoint_state(u

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
Hi Mahesh, On 4/19/22 10:40, Mahesh Vardhamanaiah wrote: xhci0: MMV Could not stop endpoint 3 xhci0: MMV Could not reset endpoint 3 Is there a chance you can find out why the XHCI controller is not accepting these commands? I mean, if the endpoint cannot be reset, also when there is no prev

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
On 4/19/22 10:40, Mahesh Vardhamanaiah wrote: xhci_get_endpoint_state(udev, epno) Could you print the return value of: xhci_get_endpoint_state(udev, epno) --HPS

RE: xhci data toggle out of sync

2022-04-19 Thread Mahesh Vardhamanaiah
siness Use Only -Original Message- From: Hans Petter Selasky Sent: Tuesday, April 19, 2022 12:33 PM To: Mahesh Vardhamanaiah ; freebsd-...@freebsd.org Cc: Steve Kiernan ; Justin Hibbits ; Kumara N Babu ; Kamal Prasad ; Kristof Provost ; Bjoern A. Zeeb Subject: Re: xhci data toggle out

Re: xhci data toggle out of sync

2022-04-19 Thread Hans Petter Selasky
Hi Mahesh, What happens if you revert SVN r365239? --HPS

RE: xhci data toggle out of sync

2022-04-18 Thread Mahesh Vardhamanaiah
Subject: Re: xhci data toggle out of sync [External Email. Be cautious of content] Hi, I think I see what is going on there. I believe this commit is a regression after r365239, that the XHCI driver only resets the data toggle when a STALL PID or USB error is received! But that is not the case

Re: xhci data toggle out of sync

2022-04-18 Thread Hans Petter Selasky
Hi, I think I see what is going on there. I believe this commit is a regression after r365239, that the XHCI driver only resets the data toggle when a STALL PID or USB error is received! But that is not the case for the BULK OUT endpoint, in your traces, because USB mass storage has two endpo

Re: xhci data toggle out of sync

2022-04-18 Thread Hans Petter Selasky
On 4/18/22 18:44, Mahesh Vardhamanaiah wrote: Hi all, Need your help regarding an urgent issue where we are observing an issue with Freebsd stable/12. The data toggles for BOT endpoint (DATA0/DATA1) are out of sync with respect to EP and the system experiences the READ(10) errors. The

xhci data toggle out of sync

2022-04-18 Thread Mahesh Vardhamanaiah
Hi all, Need your help regarding an urgent issue where we are observing an issue with Freebsd stable/12. The data toggles for BOT endpoint (DATA0/DATA1) are out of sync with respect to EP and the system experiences the READ(10) errors. The READ(10) error recovers within couple of retries