Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Stefan Roese

On 23.02.21 14:57, Aaron Williams wrote:

I am using the latest pull and it's still crashing.


Now that I have a (free) USB 3 hub I can reproduce this issue. With
latest TOT I get this:

=> usb start
starting USB...
Bus xhci@16800: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci@16900: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci@16800 for devices...
Warning: asix_eth MAC addresses don't match:
Address in ROM is   00:0e:c6:b2:7e:cb
Address in environment is   02:3f:73:97:d1:00
2 USB Device(s) found
scanning bus xhci@16900 for devices... Device not responding to 
set address.


  USB device not accepting new address (error=8000)
WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (0eebc260  1300 01008401)
BUG at drivers/usb/host/xhci-ring.c:503/abort_td()!
BUG!
resetting ...

As Aaron already mentioned, this only happens when an USB 3 hub is
present in the setup. I'll try to dig into this tomorrow but perhaps
someone else has some quick ideas?

Thanks,
Stefan


-Aaron

On Tuesday, February 23, 2021 2:39:41 AM PST Stefan Roese wrote:

On 23.02.21 11:36, Mark Kettenis wrote:

From: Nicolas Saenz Julienne 
Date: Tue, 23 Feb 2021 10:23:04 +0100

On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:

Hi Bin,
Hi Aaron,

I've added Nicolas to Cc, as he also recently did some work on the
physical vs virtual addresses in the xHCI driver.

On 23.02.21 09:07, Bin Meng wrote:

Hi Aaron,

On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams 

wrote:

I have a follow-up. USB is working on our OcteonTX boards running
2020.10. It may be something specific to the Octeon port. Note that I
did see a problem where the scratchpad memory is using direct
pointers instead of physical addresses (which will not work on MIPS).
As far as I know, however, the Octeon XHCI controller does not use
the scratchpad memory.


Do you plan to send a patch to convert the scratchpad pointer to
physical address?


Nicolas, did your patch also address the scratchpad area (sorry for not
looking myself).


Yes, my patch took care of that :).


Ah cool.  I missed that patch.  Looks like this is exactly what I need
to cater for the translation done by the IOMMU on the Apple M1.

Won't be sending that patch then ;)


Nice.

Aaron, it might be that you missed this patch series with your latest
mainline xHCI tests a few days ago. Could you please try again with
current mainline and report back, if this changes the behavior on
Octeon MIPS with USB3 hubs?

Thanks,
Stefan








Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Aaron Williams
I am using the latest pull and it's still crashing.

-Aaron

On Tuesday, February 23, 2021 2:39:41 AM PST Stefan Roese wrote:
> On 23.02.21 11:36, Mark Kettenis wrote:
> >> From: Nicolas Saenz Julienne 
> >> Date: Tue, 23 Feb 2021 10:23:04 +0100
> >> 
> >> On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:
> >>> Hi Bin,
> >>> Hi Aaron,
> >>> 
> >>> I've added Nicolas to Cc, as he also recently did some work on the
> >>> physical vs virtual addresses in the xHCI driver.
> >>> 
> >>> On 23.02.21 09:07, Bin Meng wrote:
>  Hi Aaron,
>  
>  On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  
wrote:
> > I have a follow-up. USB is working on our OcteonTX boards running
> > 2020.10. It may be something specific to the Octeon port. Note that I
> > did see a problem where the scratchpad memory is using direct
> > pointers instead of physical addresses (which will not work on MIPS).
> > As far as I know, however, the Octeon XHCI controller does not use
> > the scratchpad memory.
>  
>  Do you plan to send a patch to convert the scratchpad pointer to
>  physical address?
> >>> 
> >>> Nicolas, did your patch also address the scratchpad area (sorry for not
> >>> looking myself).
> >> 
> >> Yes, my patch took care of that :).
> > 
> > Ah cool.  I missed that patch.  Looks like this is exactly what I need
> > to cater for the translation done by the IOMMU on the Apple M1.
> > 
> > Won't be sending that patch then ;)
> 
> Nice.
> 
> Aaron, it might be that you missed this patch series with your latest
> mainline xHCI tests a few days ago. Could you please try again with
> current mainline and report back, if this changes the behavior on
> Octeon MIPS with USB3 hubs?
> 
> Thanks,
> Stefan






Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Stefan Roese

On 23.02.21 11:36, Mark Kettenis wrote:

From: Nicolas Saenz Julienne 
Date: Tue, 23 Feb 2021 10:23:04 +0100

On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:

Hi Bin,
Hi Aaron,

I've added Nicolas to Cc, as he also recently did some work on the
physical vs virtual addresses in the xHCI driver.

On 23.02.21 09:07, Bin Meng wrote:

Hi Aaron,

On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  wrote:


I have a follow-up. USB is working on our OcteonTX boards running 2020.10. It
may be something specific to the Octeon port. Note that I did see a problem
where the scratchpad memory is using direct pointers instead of physical
addresses (which will not work on MIPS). As far as I know, however, the Octeon
XHCI controller does not use the scratchpad memory.



Do you plan to send a patch to convert the scratchpad pointer to
physical address?


Nicolas, did your patch also address the scratchpad area (sorry for not
looking myself).


Yes, my patch took care of that :).


Ah cool.  I missed that patch.  Looks like this is exactly what I need
to cater for the translation done by the IOMMU on the Apple M1.

Won't be sending that patch then ;)


Nice.

Aaron, it might be that you missed this patch series with your latest
mainline xHCI tests a few days ago. Could you please try again with
current mainline and report back, if this changes the behavior on
Octeon MIPS with USB3 hubs?

Thanks,
Stefan


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Mark Kettenis
> From: Nicolas Saenz Julienne 
> Date: Tue, 23 Feb 2021 10:23:04 +0100
> 
> On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:
> > Hi Bin,
> > Hi Aaron,
> > 
> > I've added Nicolas to Cc, as he also recently did some work on the
> > physical vs virtual addresses in the xHCI driver.
> > 
> > On 23.02.21 09:07, Bin Meng wrote:
> > > Hi Aaron,
> > > 
> > > On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  
> > > wrote:
> > > > 
> > > > I have a follow-up. USB is working on our OcteonTX boards running 
> > > > 2020.10. It
> > > > may be something specific to the Octeon port. Note that I did see a 
> > > > problem
> > > > where the scratchpad memory is using direct pointers instead of physical
> > > > addresses (which will not work on MIPS). As far as I know, however, the 
> > > > Octeon
> > > > XHCI controller does not use the scratchpad memory.
> > > > 
> > > 
> > > Do you plan to send a patch to convert the scratchpad pointer to
> > > physical address?
> > 
> > Nicolas, did your patch also address the scratchpad area (sorry for not
> > looking myself).
> 
> Yes, my patch took care of that :).

Ah cool.  I missed that patch.  Looks like this is exactly what I need
to cater for the translation done by the IOMMU on the Apple M1.

Won't be sending that patch then ;)


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Nicolas Saenz Julienne
On Tue, 2021-02-23 at 10:25 +0100, Stefan Roese wrote:
> Hi Nicolas,
> 
> On 23.02.21 10:23, Nicolas Saenz Julienne wrote:
> > On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:
> > > Hi Bin,
> > > Hi Aaron,
> > > 
> > > I've added Nicolas to Cc, as he also recently did some work on the
> > > physical vs virtual addresses in the xHCI driver.
> > > 
> > > On 23.02.21 09:07, Bin Meng wrote:
> > > > Hi Aaron,
> > > > 
> > > > On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  
> > > > wrote:
> > > > > 
> > > > > I have a follow-up. USB is working on our OcteonTX boards running 
> > > > > 2020.10. It
> > > > > may be something specific to the Octeon port. Note that I did see a 
> > > > > problem
> > > > > where the scratchpad memory is using direct pointers instead of 
> > > > > physical
> > > > > addresses (which will not work on MIPS). As far as I know, however, 
> > > > > the Octeon
> > > > > XHCI controller does not use the scratchpad memory.
> > > > > 
> > > > 
> > > > Do you plan to send a patch to convert the scratchpad pointer to
> > > > physical address?
> > > 
> > > Nicolas, did your patch also address the scratchpad area (sorry for not
> > > looking myself).
> > 
> > Yes, my patch took care of that :).
> 
> Great. IIRC, your patchset may need a rebase on top of current mainline
> because of a recent xHCI patch of mine. If this is the case, could you
> please rebase the patchset and send the new version soon?

My series was merged upstream some days ago. Nothing to worry though, I added
your patch as a fixup to mine (see 1a474559d90a) in master.

Regards,
Nicolas



signature.asc
Description: This is a digitally signed message part


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Stefan Roese

Hi Nicolas,

On 23.02.21 10:23, Nicolas Saenz Julienne wrote:

On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:

Hi Bin,
Hi Aaron,

I've added Nicolas to Cc, as he also recently did some work on the
physical vs virtual addresses in the xHCI driver.

On 23.02.21 09:07, Bin Meng wrote:

Hi Aaron,

On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  wrote:


I have a follow-up. USB is working on our OcteonTX boards running 2020.10. It
may be something specific to the Octeon port. Note that I did see a problem
where the scratchpad memory is using direct pointers instead of physical
addresses (which will not work on MIPS). As far as I know, however, the Octeon
XHCI controller does not use the scratchpad memory.



Do you plan to send a patch to convert the scratchpad pointer to
physical address?


Nicolas, did your patch also address the scratchpad area (sorry for not
looking myself).


Yes, my patch took care of that :).


Great. IIRC, your patchset may need a rebase on top of current mainline
because of a recent xHCI patch of mine. If this is the case, could you
please rebase the patchset and send the new version soon?

Thanks,
Stefan


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Nicolas Saenz Julienne
On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote:
> Hi Bin,
> Hi Aaron,
> 
> I've added Nicolas to Cc, as he also recently did some work on the
> physical vs virtual addresses in the xHCI driver.
> 
> On 23.02.21 09:07, Bin Meng wrote:
> > Hi Aaron,
> > 
> > On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  
> > wrote:
> > > 
> > > I have a follow-up. USB is working on our OcteonTX boards running 
> > > 2020.10. It
> > > may be something specific to the Octeon port. Note that I did see a 
> > > problem
> > > where the scratchpad memory is using direct pointers instead of physical
> > > addresses (which will not work on MIPS). As far as I know, however, the 
> > > Octeon
> > > XHCI controller does not use the scratchpad memory.
> > > 
> > 
> > Do you plan to send a patch to convert the scratchpad pointer to
> > physical address?
> 
> Nicolas, did your patch also address the scratchpad area (sorry for not
> looking myself).

Yes, my patch took care of that :).

Regards,
Nicolas



signature.asc
Description: This is a digitally signed message part


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Aaron Williams
Hi Bin,

I can do that later. Right now I'm under the gun to get my backport working 
with a USB 3 hub. It is failing when trying to set the hub depth.

-Aaron

On Tuesday, February 23, 2021 12:07:57 AM PST Bin Meng wrote:
> Hi Aaron,
> 
> On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  
wrote:
> > I have a follow-up. USB is working on our OcteonTX boards running 2020.10.
> > It may be something specific to the Octeon port. Note that I did see a
> > problem where the scratchpad memory is using direct pointers instead of
> > physical addresses (which will not work on MIPS). As far as I know,
> > however, the Octeon XHCI controller does not use the scratchpad memory.
> 
> Do you plan to send a patch to convert the scratchpad pointer to
> physical address?
> 
> Regards,
> Bin






Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Mark Kettenis
> From: Bin Meng 
> Date: Tue, 23 Feb 2021 16:07:57 +0800
> 
> Hi Aaron,
> 
> On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  wrote:
> >
> > I have a follow-up. USB is working on our OcteonTX boards running 2020.10. 
> > It
> > may be something specific to the Octeon port. Note that I did see a problem
> > where the scratchpad memory is using direct pointers instead of physical
> > addresses (which will not work on MIPS). As far as I know, however, the 
> > Octeon
> > XHCI controller does not use the scratchpad memory.
> >
> 
> Do you plan to send a patch to convert the scratchpad pointer to
> physical address?

I actually ran into that issue while working on my port of U-Boot to
the Apple M1 machines.  Probably makes sense to do that as a separate
patch.  Will see if I can do so later today.


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Stefan Roese

Hi Bin,
Hi Aaron,

I've added Nicolas to Cc, as he also recently did some work on the
physical vs virtual addresses in the xHCI driver.

On 23.02.21 09:07, Bin Meng wrote:

Hi Aaron,

On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  wrote:


I have a follow-up. USB is working on our OcteonTX boards running 2020.10. It
may be something specific to the Octeon port. Note that I did see a problem
where the scratchpad memory is using direct pointers instead of physical
addresses (which will not work on MIPS). As far as I know, however, the Octeon
XHCI controller does not use the scratchpad memory.



Do you plan to send a patch to convert the scratchpad pointer to
physical address?


Nicolas, did your patch also address the scratchpad area (sorry for not
looking myself).

Thanks,
Stefan



Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Bin Meng
Hi Aaron,

On Tue, Feb 23, 2021 at 3:31 PM Aaron Williams  wrote:
>
> I have a follow-up. USB is working on our OcteonTX boards running 2020.10. It
> may be something specific to the Octeon port. Note that I did see a problem
> where the scratchpad memory is using direct pointers instead of physical
> addresses (which will not work on MIPS). As far as I know, however, the Octeon
> XHCI controller does not use the scratchpad memory.
>

Do you plan to send a patch to convert the scratchpad pointer to
physical address?

Regards,
Bin


Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-22 Thread Aaron Williams
I have a follow-up. USB is working on our OcteonTX boards running 2020.10. It 
may be something specific to the Octeon port. Note that I did see a problem 
where the scratchpad memory is using direct pointers instead of physical 
addresses (which will not work on MIPS). As far as I know, however, the Octeon 
XHCI controller does not use the scratchpad memory.

-Aaron

On Friday, February 19, 2021 5:57:47 AM PST Aaron Williams wrote:
> External Email
> 
> --
> Hi all,
> 
> While backporting the latest USB support in U-Boot to support USB 3 hubs I
> decided to try the latest U-Boot for Octeon which should contain everything.
> When I start USB, however, with a USB 3 thumb drive plugged into a USB 3
> hub, I am seeing a crash. I have enabled all of the debugging support for
> usb.c, usb_hub.c, xhci.c, xhci-ring.c and xhci_mem.c
> 
> In my backported code which is a bit hacked up due to the lack of DT
> support, I am seeing it fail when it attempts to set the hub depth. Note
> that everything works fine with a USB 2 hub. I was hoping to compare the
> stock U- Boot with my hacked up code to track down the issue.
> 
> -Aaron
> 
> Here are the logs:
> 
> => usb start
> starting USB...
> Bus xhci@16800: xhci_register: dev='xhci@16800',
> ctrl=8eea1aa0, hccr=80016800, hcor=80016820
> // Halt the HC: 80016820
> // Reset the HC
> Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.00
> Bus xhci@16900: xhci_register: dev='xhci@16900',
> ctrl=8eeab040, hccr=80016900, hcor=80016920
> // Halt the HC: 80016920
> // Reset the HC
> Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.00
> scanning bus xhci@16800 for devices... xhci_alloc_device:
> dev='xhci@16800', udev=8ee9c280
> set address 1
> usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length
> 0x0
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_REQ_SET_ADDRESS
> scrlen = 0
>  req->length = 0
> Len is 0
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0
> length 0x12
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_DEVICE request
> scrlen = 18
>  req->length = 18
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0
> length 0x9
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_CONFIG config
> scrlen = 25
>  req->length = 9
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0
> length 0x1F
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_CONFIG config
> scrlen = 25
>  req->length = 31
> get_conf_no 0 Result 25, wLength 31
> if 0, ep 0
> ##EP epmaxpacketin[1] = 2048
> set configuration 1
> usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length
> 0x0
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> scrlen = 0
>  req->length = 0
> Len is 0
> new device strings: Mfr=1, Product=2, SerialNumber=0
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0
> length 0xFF
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_STRING config
> scrlen = 4
>  req->length = 255
> USB device number 1 default language ID 0x409
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x409
> length 0xFF
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_STRING config
> scrlen = 14
>  req->length = 255
> usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x409
> length 0xFF
> xhci_submit_control_msg: dev='xhci@16800', udev=8ee9c280,
> udev->dev='xhci@16800', portnr=0
> USB_DT_STRING config
> scrlen = 42
>  req->length = 255
> Manufacturer U-Boot
> Product  XHCI Host Controller
> SerialNumber
> usb_hub_post_probe
> usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0
> length 0x4
> xhci_submit_control_msg: dev='xhci@16800', udev=8eeae040,
> udev->dev='usb_hub', portnr=0
> USB_DT_HUB config
> scrlen = 8
>  req->length = 4
> usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0
> length 0xC
> xhci_submit_control_msg: dev='xhci@16800', udev=8eeae040,
> udev->dev='usb_hub', portnr=0
> USB_DT_HUB config
> scrlen = 8
>  req->length = 12
> 2 ports detected
> ganged power switching
> standalone hub
> individual port over-current protection
> TT requires at most 8 FS bit times (666 ns)
> power on to power good t