This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: PCIe USB hub failures

Part Number: AM5728
Other Parts Discussed in Thread: TUSB7340, , TUSB8041

Tool/software: Linux

We are developing a product based on the TI AM5728 EVM.  The product utilizes a TUSB7340 PCIe USB for additional USB ports.  The TUSB7340 is detected and setup properly and works OK with low data rate devices.  However, hot plugging a Realtek USB network adapter and doing Ethernet transfer bandwidth testing using iperf3 causes the host to be  locked out.  The TUSB7340 host appears to no longer communicate and the logging indicates xhci_hcd 0000:01:00.0: HC died; cleaning up.

We tried to setup a test on the TI AM5728 EVM using the TI TUSB7340 EVM and a PCIe adapter cable, but were not able to get a stable PCIe bus even with GEN1 speeds and were unable to replicate the test.

So we looked at using another host and found a mini PCIe card that utilizes the µPD720201 and can be directly installed to the LCD on the EVM.  The card is detected properly and we reran the transfer test.  The uPD720201 gets locks out with the same problem.

The AM5728 testing was performed using the stock am57xx-evm-linux-04.00.00.04.img on the SD card, kernel am57xx-evm 4.9.28-geed43d1050, and it reports that it is using the TI AM572x EVM Rev A3 Device tree.

It shows the following logging when it fails.

[  630.400899] xhci_hcd 0000:01:00.0: xHCI host not responding to stop endpoint command.

[  630.408769] xhci_hcd 0000:01:00.0: Assuming host is dying, halting host.

[  630.420849] r8152 2-4:1.0 enp1s0u4: Tx status -108

[  630.425667] r8152 2-4:1.0 enp1s0u4: Tx status -108

[  630.430483] r8152 2-4:1.0 enp1s0u4: Tx status -108

[  630.435297] r8152 2-4:1.0 enp1s0u4: Tx status -108

[  630.440122] xhci_hcd 0000:01:00.0: HC died; cleaning up

[  630.453961] usb 2-4: USB disconnect, device number 2

The problem appears to be a general driver issue given we get the same problem with both the TUSB7340 and the µPD720201.

Any suggestions on how we can address this problem?

Thanks!

  • We're looking into this. Feedback will be posted here.

    Best Regards,
    Yordan
  • Any ideas on this? I can give it until the end of the week, but will have to take this to the Linux USB group after that as this is a serious problem for our product.
  • Chris,

    Chris Welch66 said:

    [  630.400899] xhci_hcd 0000:01:00.0: xHCI host not responding to stop endpoint command.
    [  630.408769] xhci_hcd 0000:01:00.0: Assuming host is dying, halting host.

    There are many things which could cause this type of error, but mainly due to dma info configuration problem in the kernel. I don't have a setup to run your test case, but can you please test with the two patches attached below? If they don't solve the issue, can you please test with the latest community kernel (currently v4.13-rc7)?

    0001-usb-separate-out-sysdev-pointer-from-usb_bus.patch.txt
    From a8c06e407ef969461b7f51ec72839fe382dd3c29 Mon Sep 17 00:00:00 2001
    From: Arnd Bergmann <arnd@arndb.de>
    Date: Mon, 13 Mar 2017 10:18:41 +0800
    Subject: [PATCH] usb: separate out sysdev pointer from usb_bus
    
    For xhci-hcd platform device, all the DMA parameters are not
    configured properly, notably dma ops for dwc3 devices.
    
    The idea here is that you pass in the parent of_node along with
    the child device pointer, so it would behave exactly like the
    parent already does. The difference is that it also handles all
    the other attributes besides the mask.
    
    sysdev will represent the physical device, as seen from firmware
    or bus.Splitting the usb_bus->controller field into the
    Linux-internal device (used for the sysfs hierarchy, for printks
    and for power management) and a new pointer (used for DMA,
    DT enumeration and phy lookup) probably covers all that we really
    need.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
    Tested-by: Baolin Wang <baolin.wang@linaro.org>
    Tested-by: Brian Norris <briannorris@chromium.org>
    Tested-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
    Tested-by: Vivek Gautam <vivek.gautam@codeaurora.org>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Peter Chen <peter.chen@nxp.com>
    Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
    Cc: Grygorii Strashko <grygorii.strashko@ti.com>
    Cc: Sinjan Kumar <sinjank@codeaurora.org>
    Cc: David Fisher <david.fisher1@synopsys.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: "Thang Q. Nguyen" <tqnguyen@apm.com>
    Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Cc: Stephen Boyd <sboyd@codeaurora.org>
    Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
    Cc: Ming Lei <tom.leiming@gmail.com>
    Cc: Jon Masters <jcm@redhat.com>
    Cc: Dann Frazier <dann.frazier@canonical.com>
    Cc: Peter Chen <peter.chen@nxp.com>
    Cc: Leo Li <pku.leo@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
     drivers/usb/core/buffer.c | 12 +++----
     drivers/usb/core/hcd.c    | 80 ++++++++++++++++++++++++++---------------------
     drivers/usb/core/usb.c    | 18 +++++------
     include/linux/usb.h       |  1 +
     include/linux/usb/hcd.h   |  3 ++
     5 files changed, 64 insertions(+), 50 deletions(-)
    
    diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
    index b9bf6e2eb6fe..b64568cf572c 100644
    --- a/drivers/usb/core/buffer.c
    +++ b/drivers/usb/core/buffer.c
    @@ -66,7 +66,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
     	int		i, size;
     
     	if (!IS_ENABLED(CONFIG_HAS_DMA) ||
    -	    (!hcd->self.controller->dma_mask &&
    +	    (!is_device_dma_capable(hcd->self.sysdev) &&
     	     !(hcd->driver->flags & HCD_LOCAL_MEM)))
     		return 0;
     
    @@ -75,7 +75,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
     		if (!size)
     			continue;
     		snprintf(name, sizeof(name), "buffer-%d", size);
    -		hcd->pool[i] = dma_pool_create(name, hcd->self.controller,
    +		hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev,
     				size, size, 0);
     		if (!hcd->pool[i]) {
     			hcd_buffer_destroy(hcd);
    @@ -130,7 +130,7 @@ void *hcd_buffer_alloc(
     
     	/* some USB hosts just use PIO */
     	if (!IS_ENABLED(CONFIG_HAS_DMA) ||
    -	    (!bus->controller->dma_mask &&
    +	    (!is_device_dma_capable(bus->sysdev) &&
     	     !(hcd->driver->flags & HCD_LOCAL_MEM))) {
     		*dma = ~(dma_addr_t) 0;
     		return kmalloc(size, mem_flags);
    @@ -140,7 +140,7 @@ void *hcd_buffer_alloc(
     		if (size <= pool_max[i])
     			return dma_pool_alloc(hcd->pool[i], mem_flags, dma);
     	}
    -	return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
    +	return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags);
     }
     
     void hcd_buffer_free(
    @@ -157,7 +157,7 @@ void hcd_buffer_free(
     		return;
     
     	if (!IS_ENABLED(CONFIG_HAS_DMA) ||
    -	    (!bus->controller->dma_mask &&
    +	    (!is_device_dma_capable(bus->sysdev) &&
     	     !(hcd->driver->flags & HCD_LOCAL_MEM))) {
     		kfree(addr);
     		return;
    @@ -169,5 +169,5 @@ void hcd_buffer_free(
     			return;
     		}
     	}
    -	dma_free_coherent(hcd->self.controller, size, addr, dma);
    +	dma_free_coherent(hcd->self.sysdev, size, addr, dma);
     }
    diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
    index 612fab6e54fb..2342c1ffd900 100644
    --- a/drivers/usb/core/hcd.c
    +++ b/drivers/usb/core/hcd.c
    @@ -1073,6 +1073,7 @@ static void usb_deregister_bus (struct usb_bus *bus)
     static int register_root_hub(struct usb_hcd *hcd)
     {
     	struct device *parent_dev = hcd->self.controller;
    +	struct device *sysdev = hcd->self.sysdev;
     	struct usb_device *usb_dev = hcd->self.root_hub;
     	const int devnum = 1;
     	int retval;
    @@ -1119,7 +1120,7 @@ static int register_root_hub(struct usb_hcd *hcd)
     		/* Did the HC die before the root hub was registered? */
     		if (HCD_DEAD(hcd))
     			usb_hc_died (hcd);	/* This time clean up */
    -		usb_dev->dev.of_node = parent_dev->of_node;
    +		usb_dev->dev.of_node = sysdev->of_node;
     	}
     	mutex_unlock(&usb_bus_idr_lock);
     
    @@ -1465,19 +1466,19 @@ void usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
     	dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
     	if (IS_ENABLED(CONFIG_HAS_DMA) &&
     	    (urb->transfer_flags & URB_DMA_MAP_SG))
    -		dma_unmap_sg(hcd->self.controller,
    +		dma_unmap_sg(hcd->self.sysdev,
     				urb->sg,
     				urb->num_sgs,
     				dir);
     	else if (IS_ENABLED(CONFIG_HAS_DMA) &&
     		 (urb->transfer_flags & URB_DMA_MAP_PAGE))
    -		dma_unmap_page(hcd->self.controller,
    +		dma_unmap_page(hcd->self.sysdev,
     				urb->transfer_dma,
     				urb->transfer_buffer_length,
     				dir);
     	else if (IS_ENABLED(CONFIG_HAS_DMA) &&
     		 (urb->transfer_flags & URB_DMA_MAP_SINGLE))
    -		dma_unmap_single(hcd->self.controller,
    +		dma_unmap_single(hcd->self.sysdev,
     				urb->transfer_dma,
     				urb->transfer_buffer_length,
     				dir);
    @@ -1520,11 +1521,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
     			return ret;
     		if (IS_ENABLED(CONFIG_HAS_DMA) && hcd->self.uses_dma) {
     			urb->setup_dma = dma_map_single(
    -					hcd->self.controller,
    +					hcd->self.sysdev,
     					urb->setup_packet,
     					sizeof(struct usb_ctrlrequest),
     					DMA_TO_DEVICE);
    -			if (dma_mapping_error(hcd->self.controller,
    +			if (dma_mapping_error(hcd->self.sysdev,
     						urb->setup_dma))
     				return -EAGAIN;
     			urb->transfer_flags |= URB_SETUP_MAP_SINGLE;
    @@ -1555,7 +1556,7 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
     				}
     
     				n = dma_map_sg(
    -						hcd->self.controller,
    +						hcd->self.sysdev,
     						urb->sg,
     						urb->num_sgs,
     						dir);
    @@ -1570,12 +1571,12 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
     			} else if (urb->sg) {
     				struct scatterlist *sg = urb->sg;
     				urb->transfer_dma = dma_map_page(
    -						hcd->self.controller,
    +						hcd->self.sysdev,
     						sg_page(sg),
     						sg->offset,
     						urb->transfer_buffer_length,
     						dir);
    -				if (dma_mapping_error(hcd->self.controller,
    +				if (dma_mapping_error(hcd->self.sysdev,
     						urb->transfer_dma))
     					ret = -EAGAIN;
     				else
    @@ -1585,11 +1586,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
     				ret = -EAGAIN;
     			} else {
     				urb->transfer_dma = dma_map_single(
    -						hcd->self.controller,
    +						hcd->self.sysdev,
     						urb->transfer_buffer,
     						urb->transfer_buffer_length,
     						dir);
    -				if (dma_mapping_error(hcd->self.controller,
    +				if (dma_mapping_error(hcd->self.sysdev,
     						urb->transfer_dma))
     					ret = -EAGAIN;
     				else
    @@ -2495,24 +2496,8 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
     	tasklet_init(&bh->bh, usb_giveback_urb_bh, (unsigned long)bh);
     }
     
    -/**
    - * usb_create_shared_hcd - create and initialize an HCD structure
    - * @driver: HC driver that will use this hcd
    - * @dev: device for this HC, stored in hcd->self.controller
    - * @bus_name: value to store in hcd->self.bus_name
    - * @primary_hcd: a pointer to the usb_hcd structure that is sharing the
    - *              PCI device.  Only allocate certain resources for the primary HCD
    - * Context: !in_interrupt()
    - *
    - * Allocate a struct usb_hcd, with extra space at the end for the
    - * HC driver's private data.  Initialize the generic members of the
    - * hcd structure.
    - *
    - * Return: On success, a pointer to the created and initialized HCD structure.
    - * On failure (e.g. if memory is unavailable), %NULL.
    - */
    -struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
    -		struct device *dev, const char *bus_name,
    +struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
    +		struct device *sysdev, struct device *dev, const char *bus_name,
     		struct usb_hcd *primary_hcd)
     {
     	struct usb_hcd *hcd;
    @@ -2553,8 +2538,9 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
     
     	usb_bus_init(&hcd->self);
     	hcd->self.controller = dev;
    +	hcd->self.sysdev = sysdev;
     	hcd->self.bus_name = bus_name;
    -	hcd->self.uses_dma = (dev->dma_mask != NULL);
    +	hcd->self.uses_dma = (sysdev->dma_mask != NULL);
     
     	init_timer(&hcd->rh_timer);
     	hcd->rh_timer.function = rh_timer_func;
    @@ -2569,6 +2555,30 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
     			"USB Host Controller";
     	return hcd;
     }
    +EXPORT_SYMBOL_GPL(__usb_create_hcd);
    +
    +/**
    + * usb_create_shared_hcd - create and initialize an HCD structure
    + * @driver: HC driver that will use this hcd
    + * @dev: device for this HC, stored in hcd->self.controller
    + * @bus_name: value to store in hcd->self.bus_name
    + * @primary_hcd: a pointer to the usb_hcd structure that is sharing the
    + *              PCI device.  Only allocate certain resources for the primary HCD
    + * Context: !in_interrupt()
    + *
    + * Allocate a struct usb_hcd, with extra space at the end for the
    + * HC driver's private data.  Initialize the generic members of the
    + * hcd structure.
    + *
    + * Return: On success, a pointer to the created and initialized HCD structure.
    + * On failure (e.g. if memory is unavailable), %NULL.
    + */
    +struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
    +		struct device *dev, const char *bus_name,
    +		struct usb_hcd *primary_hcd)
    +{
    +	return __usb_create_hcd(driver, dev, dev, bus_name, primary_hcd);
    +}
     EXPORT_SYMBOL_GPL(usb_create_shared_hcd);
     
     /**
    @@ -2588,7 +2598,7 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
     struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
     		struct device *dev, const char *bus_name)
     {
    -	return usb_create_shared_hcd(driver, dev, bus_name, NULL);
    +	return __usb_create_hcd(driver, dev, dev, bus_name, NULL);
     }
     EXPORT_SYMBOL_GPL(usb_create_hcd);
     
    @@ -2715,7 +2725,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
     	struct usb_device *rhdev;
     
     	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->usb_phy) {
    -		struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0);
    +		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
     
     		if (IS_ERR(phy)) {
     			retval = PTR_ERR(phy);
    @@ -2733,7 +2743,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
     	}
     
     	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
    -		struct phy *phy = phy_get(hcd->self.controller, "usb");
    +		struct phy *phy = phy_get(hcd->self.sysdev, "usb");
     
     		if (IS_ERR(phy)) {
     			retval = PTR_ERR(phy);
    @@ -2781,7 +2791,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
     	 */
     	retval = hcd_buffer_create(hcd);
     	if (retval != 0) {
    -		dev_dbg(hcd->self.controller, "pool alloc failed\n");
    +		dev_dbg(hcd->self.sysdev, "pool alloc failed\n");
     		goto err_create_buf;
     	}
     
    @@ -2791,7 +2801,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
     
     	rhdev = usb_alloc_dev(NULL, &hcd->self, 0);
     	if (rhdev == NULL) {
    -		dev_err(hcd->self.controller, "unable to allocate root hub\n");
    +		dev_err(hcd->self.sysdev, "unable to allocate root hub\n");
     		retval = -ENOMEM;
     		goto err_allocate_root_hub;
     	}
    diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
    index a2ccc69fb45c..4cd6e0e4b66d 100644
    --- a/drivers/usb/core/usb.c
    +++ b/drivers/usb/core/usb.c
    @@ -453,9 +453,9 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
     	 * Note: calling dma_set_mask() on a USB device would set the
     	 * mask for the entire HCD, so don't do that.
     	 */
    -	dev->dev.dma_mask = bus->controller->dma_mask;
    -	dev->dev.dma_pfn_offset = bus->controller->dma_pfn_offset;
    -	set_dev_node(&dev->dev, dev_to_node(bus->controller));
    +	dev->dev.dma_mask = bus->sysdev->dma_mask;
    +	dev->dev.dma_pfn_offset = bus->sysdev->dma_pfn_offset;
    +	set_dev_node(&dev->dev, dev_to_node(bus->sysdev));
     	dev->state = USB_STATE_ATTACHED;
     	dev->lpm_disable_count = 1;
     	atomic_set(&dev->urbnum, 0);
    @@ -803,7 +803,7 @@ struct urb *usb_buffer_map(struct urb *urb)
     	if (!urb
     			|| !urb->dev
     			|| !(bus = urb->dev->bus)
    -			|| !(controller = bus->controller))
    +			|| !(controller = bus->sysdev))
     		return NULL;
     
     	if (controller->dma_mask) {
    @@ -841,7 +841,7 @@ void usb_buffer_dmasync(struct urb *urb)
     			|| !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)
     			|| !urb->dev
     			|| !(bus = urb->dev->bus)
    -			|| !(controller = bus->controller))
    +			|| !(controller = bus->sysdev))
     		return;
     
     	if (controller->dma_mask) {
    @@ -875,7 +875,7 @@ void usb_buffer_unmap(struct urb *urb)
     			|| !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)
     			|| !urb->dev
     			|| !(bus = urb->dev->bus)
    -			|| !(controller = bus->controller))
    +			|| !(controller = bus->sysdev))
     		return;
     
     	if (controller->dma_mask) {
    @@ -925,7 +925,7 @@ int usb_buffer_map_sg(const struct usb_device *dev, int is_in,
     
     	if (!dev
     			|| !(bus = dev->bus)
    -			|| !(controller = bus->controller)
    +			|| !(controller = bus->sysdev)
     			|| !controller->dma_mask)
     		return -EINVAL;
     
    @@ -961,7 +961,7 @@ void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in,
     
     	if (!dev
     			|| !(bus = dev->bus)
    -			|| !(controller = bus->controller)
    +			|| !(controller = bus->sysdev)
     			|| !controller->dma_mask)
     		return;
     
    @@ -989,7 +989,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
     
     	if (!dev
     			|| !(bus = dev->bus)
    -			|| !(controller = bus->controller)
    +			|| !(controller = bus->sysdev)
     			|| !controller->dma_mask)
     		return;
     
    diff --git a/include/linux/usb.h b/include/linux/usb.h
    index 7e68259360de..148752640693 100644
    --- a/include/linux/usb.h
    +++ b/include/linux/usb.h
    @@ -354,6 +354,7 @@ struct usb_devmap {
      */
     struct usb_bus {
     	struct device *controller;	/* host/master side hardware */
    +	struct device *sysdev;		/* as seen from firmware or bus */
     	int busnum;			/* Bus number (in order of reg) */
     	const char *bus_name;		/* stable id (PCI slot_name etc) */
     	u8 uses_dma;			/* Does the host controller use DMA? */
    diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
    index dff130151235..a469999a106d 100644
    --- a/include/linux/usb/hcd.h
    +++ b/include/linux/usb/hcd.h
    @@ -437,6 +437,9 @@ extern int usb_hcd_alloc_bandwidth(struct usb_device *udev,
     		struct usb_host_interface *new_alt);
     extern int usb_hcd_get_frame_number(struct usb_device *udev);
     
    +struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
    +		struct device *sysdev, struct device *dev, const char *bus_name,
    +		struct usb_hcd *primary_hcd);
     extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
     		struct device *dev, const char *bus_name);
     extern struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
    -- 
    1.9.1
    
    

    0002-usb-xhci-use-bus-sysdev-for-DMA-configuration.patch.txt
    From 4c39d4b949d36faffbc726525b469886cf311d1c Mon Sep 17 00:00:00 2001
    From: Arnd Bergmann <arnd@arndb.de>
    Date: Mon, 13 Mar 2017 10:18:44 +0800
    Subject: [PATCH] usb: xhci: use bus->sysdev for DMA configuration
    
    For xhci-hcd platform device, all the DMA parameters are not
    configured properly, notably dma ops for dwc3 devices. So, set
    the dma for xhci from sysdev. sysdev is pointing to device that
    is known to the system firmware or hardware.
    
    Cc: Baolin Wang <baolin.wang@linaro.org>
    
    Tested-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
    Tested-by: Vivek Gautam <vivek.gautam@codeaurora.org>
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Peter Chen <peter.chen@nxp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
     drivers/usb/host/xhci-mem.c  | 12 ++++++------
     drivers/usb/host/xhci-plat.c | 35 +++++++++++++++++++++++++++--------
     drivers/usb/host/xhci.c      | 15 +++++++++++----
     3 files changed, 44 insertions(+), 18 deletions(-)
    
    diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
    index ba1853f4e407..032a7020a6b0 100644
    --- a/drivers/usb/host/xhci-mem.c
    +++ b/drivers/usb/host/xhci-mem.c
    @@ -586,7 +586,7 @@ static void xhci_free_stream_ctx(struct xhci_hcd *xhci,
     		unsigned int num_stream_ctxs,
     		struct xhci_stream_ctx *stream_ctx, dma_addr_t dma)
     {
    -	struct device *dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
     	size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
     
     	if (size > MEDIUM_STREAM_ARRAY_SIZE)
    @@ -614,7 +614,7 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci,
     		unsigned int num_stream_ctxs, dma_addr_t *dma,
     		gfp_t mem_flags)
     {
    -	struct device *dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
     	size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
     
     	if (size > MEDIUM_STREAM_ARRAY_SIZE)
    @@ -1686,7 +1686,7 @@ void xhci_slot_copy(struct xhci_hcd *xhci,
     static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
     {
     	int i;
    -	struct device *dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
     	int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
     
     	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
    @@ -1758,7 +1758,7 @@ static void scratchpad_free(struct xhci_hcd *xhci)
     {
     	int num_sp;
     	int i;
    -	struct device *dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
     
     	if (!xhci->scratchpad)
     		return;
    @@ -1831,7 +1831,7 @@ void xhci_free_command(struct xhci_hcd *xhci,
     
     void xhci_mem_cleanup(struct xhci_hcd *xhci)
     {
    -	struct device	*dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device	*dev = xhci_to_hcd(xhci)->self.sysdev;
     	int size;
     	int i, j, num_ports;
     
    @@ -2373,7 +2373,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
     int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
     {
     	dma_addr_t	dma;
    -	struct device	*dev = xhci_to_hcd(xhci)->self.controller;
    +	struct device	*dev = xhci_to_hcd(xhci)->self.sysdev;
     	unsigned int	val, val2;
     	u64		val_64;
     	struct xhci_segment	*seg;
    diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
    index bd02a6cd8e2c..fa97826d0058 100644
    --- a/drivers/usb/host/xhci-plat.c
    +++ b/drivers/usb/host/xhci-plat.c
    @@ -14,6 +14,7 @@
     #include <linux/clk.h>
     #include <linux/dma-mapping.h>
     #include <linux/module.h>
    +#include <linux/pci.h>
     #include <linux/of.h>
     #include <linux/platform_device.h>
     #include <linux/usb/phy.h>
    @@ -148,6 +149,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
     {
     	const struct of_device_id *match;
     	const struct hc_driver	*driver;
    +	struct device		*sysdev;
     	struct xhci_hcd		*xhci;
     	struct resource         *res;
     	struct usb_hcd		*hcd;
    @@ -164,22 +166,39 @@ static int xhci_plat_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return -ENODEV;
     
    +	/*
    +	 * sysdev must point to a device that is known to the system firmware
    +	 * or PCI hardware. We handle these three cases here:
    +	 * 1. xhci_plat comes from firmware
    +	 * 2. xhci_plat is child of a device from firmware (dwc3-plat)
    +	 * 3. xhci_plat is grandchild of a pci device (dwc3-pci)
    +	 */
    +	sysdev = &pdev->dev;
    +	if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node)
    +		sysdev = sysdev->parent;
    +#ifdef CONFIG_PCI
    +	else if (sysdev->parent && sysdev->parent->parent &&
    +		 sysdev->parent->parent->bus == &pci_bus_type)
    +		sysdev = sysdev->parent->parent;
    +#endif
    +
     	/* Try to set 64-bit DMA first */
    -	if (!pdev->dev.dma_mask)
    +	if (WARN_ON(!sysdev->dma_mask))
     		/* Platform did not initialize dma_mask */
    -		ret = dma_coerce_mask_and_coherent(&pdev->dev,
    +		ret = dma_coerce_mask_and_coherent(sysdev,
     						   DMA_BIT_MASK(64));
     	else
    -		ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
    +		ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
     
     	/* If seting 64-bit DMA mask fails, fall back to 32-bit DMA mask */
     	if (ret) {
    -		ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
    +		ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(32));
     		if (ret)
     			return ret;
     	}
     
    -	hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
    +	hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
    +			       dev_name(&pdev->dev), NULL);
     	if (!hcd)
     		return -ENOMEM;
     
    @@ -222,20 +241,20 @@ static int xhci_plat_probe(struct platform_device *pdev)
     
     	xhci->clk = clk;
     	xhci->main_hcd = hcd;
    -	xhci->shared_hcd = usb_create_shared_hcd(driver, &pdev->dev,
    +	xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
     			dev_name(&pdev->dev), hcd);
     	if (!xhci->shared_hcd) {
     		ret = -ENOMEM;
     		goto disable_clk;
     	}
     
    -	if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable"))
    +	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
     		xhci->quirks |= XHCI_LPM_SUPPORT;
     
     	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
     		xhci->quirks |= XHCI_BROKEN_PORT_PED;
     
    -	hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
    +	hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
     	if (IS_ERR(hcd->usb_phy)) {
     		ret = PTR_ERR(hcd->usb_phy);
     		if (ret == -EPROBE_DEFER)
    diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
    index bb0becf8561c..1828695ddab8 100644
    --- a/drivers/usb/host/xhci.c
    +++ b/drivers/usb/host/xhci.c
    @@ -237,6 +237,9 @@ static int xhci_free_msi(struct xhci_hcd *xhci)
     static int xhci_setup_msi(struct xhci_hcd *xhci)
     {
     	int ret;
    +	/*
    +	 * TODO:Check with MSI Soc for sysdev
    +	 */
     	struct pci_dev  *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
     
     	ret = pci_enable_msi(pdev);
    @@ -263,7 +266,7 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
      */
     static void xhci_free_irq(struct xhci_hcd *xhci)
     {
    -	struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
    +	struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
     	int ret;
     
     	/* return if using legacy interrupt */
    @@ -748,7 +751,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
     	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
     
     	if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
    -		usb_disable_xhci_ports(to_pci_dev(hcd->self.controller));
    +		usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
     
     	spin_lock_irq(&xhci->lock);
     	xhci_halt(xhci);
    @@ -765,7 +768,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
     
     	/* Yet another workaround for spurious wakeups at shutdown with HSW */
     	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
    -		pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot);
    +		pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot);
     }
     
     #ifdef CONFIG_PM
    @@ -4801,7 +4804,11 @@ int xhci_get_frame(struct usb_hcd *hcd)
     int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
     {
     	struct xhci_hcd		*xhci;
    -	struct device		*dev = hcd->self.controller;
    +	/*
    +	 * TODO: Check with DWC3 clients for sysdev according to
    +	 * quirks
    +	 */
    +	struct device		*dev = hcd->self.sysdev;
     	int			retval;
     
     	/* Accept arbitrarily long scatter-gather lists */
    -- 
    1.9.1
    
    

  • Thanks Bin, I'll give it a try
  • How do I get the lastest community kernel and what compiler should be used to build it?

    processors.wiki.ti.com/.../Processor_SDK_Building_The_SDK

    only documents how to line up with the latest SDKs 04.00.00.04 which is the am57xx-evm 4.9.28-geed43d1050 kernel.

    They document retrieving the base git repository as:

    git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk

    arago-project.org/.../Main_Page unfortunately doesn't document what kernel versions are used for the release.


    Thanks.
  • Chris,

    So the patches above didn't solve the issue for you?

    The community just released kernel v4.13 in the last weekend, you can either download it from kernel.org or clone the kernel tree and checkout tag v4.13. The command to build the kernel:

    $ export ARCH=arm
    $ export CROSS_COMPILE=<your arm toolchain>
    $ make omap2plus_defconfig
    $ make zImage modules dtbs

  • The kernel I've been testing with has those patches already, 4.9.45-ti-r57.

    I've found the 4.9.45-ti-r57 to be less stable than the 4.4.49-ti-r89 we were previously using.  USB hot plugging unplugging causes the TUSB7340 to hang in a similar fashion as the data transfer.  And I've gotten a complete kernel crash a number of times unplugging a USB 3.0 network adapter from a TUSB8041 hub we have on the AM5728 USB host port.

    These problems don't occur with the 4.4.49 kernel.

    I've been trying to build the latest 4.12.3 kernel, but documentation is poor for building it outside of the SDK so I'm trying to reverse engineer the steps.

  • Thanks for the 4.13 info, I'll give it a try
  • The instructions can be used to compile any kernel version, but some kernel might not boot on am57x board due to missing fundamental patches. I have tested the community kernel v4.13 can boot on am57x evm.
  • The v4.13 branch builds a 4.12.3 kernel:

    cwelch@ubuntuvm:~/map300/ti-linux-kernel-4.12.3$ git branch
    map300_4.12.3
    map300_4.13
    master
    * v4.13

    strings arch/arm/boot/Image | grep '4\.'
    pP4.
    Linux version 4.12.3-00001-gc829ebc (cwelch@ubuntuvm) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #1 SMP Fri Sep 8 10:53:25 EDT 2017
    4.12.3-00001-gc829ebc SMP mod_unload modversions ARMv6 p2v8

    so same result.

    I think it is best that I take this to the Linux USB mail list as the problem needs to be specifically investigated. It is easy to reproduce and is present in a wide number of kernel versions. I suspect it is a fundamental bug in the xhci code.

  • It depends on how your v4.13 branch is created, it might not point to the v4.13 tree on your PC. You can use the following command to checkout the v4.13 release tag.

    $ git checkout -b tag-v4.13 refs/tags/v4.13

    You have to reproduce the issue on the *latest* *community* kernel if you want to report the issue to the Linux usb mailing list; otherwise, the community wouldn't be able to help.

  • Cloned the repo on Monday.

    cwelch@ubuntuvm:~/map300/ti-linux-kernel-4.12.3$ git checkout -b tag-v4.13 refs/tags/v4.13
    fatal: Cannot update paths and switch to branch 'tag-v4.13' at the same time.
    Did you intend to checkout 'refs/tags/v4.13' which can not be resolved as commit?
  • Chris Welch66 said:
    Did you intend to checkout 'refs/tags/v4.13' which can not be resolved as commit?

    Yes, it is to checkout the v4.13 release tag.

    Chris Welch66 said:
    cwelch@ubuntuvm:~/map300/ti-linux-kernel-4.12.3$ git checkout -b tag-v4.13 refs/tags/v4.13
    fatal: Cannot update paths and switch to branch 'tag-v4.13' at the same time.

    I guess the kernel repo you cloned doesn't include the v4.13 release.

    You can either clone the kernel tree from kernel.org, or just download the kernel v4.13 release tarball from kernel.org.

  • It comes from git.ti.com/ti-linux-kernel

    Silly me for expecting that would be the TI community linux kernel :)

    I'll try kernel.org.
  • The 4.13.1 kernel is worse.  The TUSB7340 fails after one packet transfer over the USB Ethernet interface with the iperf3 test:

    root@arm:~# !iperf3
    iperf3 -c 10.14.21.95 -t 6000
    Connecting to host 10.14.21.95, port 5201
    [ 4] local 10.14.21.89 port 60978 connected to 10.14.21.95 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 14.2 MBytes 119 Mbits/sec 1 1.41 KBytes
    [ 4] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    ^C[ 4] 7.00-7.48 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval Transfer Bandwidth Retr
    [ 4] 0.00-7.48 sec 14.2 MBytes 15.9 Mbits/sec 1 sender
    [ 4] 0.00-7.48 sec 0.00 Bytes 0.00 bits/sec receiver
    iperf3: interrupt - the client has terminated
    root@arm:~# [ 118.187204] xhci_hcd 0001:07:00.0: xHCI host controller not responding, assume dead
    [ 118.196419] xhci_hcd 0001:07:00.0: HC died; cleaning up

  • Some additional information, the stock 4.13.1 build hangs on the TI AM5728 EVM during boot up.  I was only able to get 4.13.1 to work on our product (previous reply output).

    Stock linux 4.13.1 tarball extraction.

    export ARCH=arm
    export CROSS_COMPILE=/home/wel52996/map300/armv7-lpae-multiplatform/dl/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

    make distclean
    make omap2plus_defconfig
    make zImage modules dtbs

    Here is the last bit of output before the hang:

    [ 2.252316] omap_hsmmc 480ad000.mmc: could not find pctldev for node /ocp/padconf@4844a000/mmc3_iodelay_manual1_conf, deferring probe
    [ 2.265788] ledtrig-cpu: registered to indicate activity on CPUs
    [ 2.273255] oprofile: using timer interrupt.
    [ 2.278076] Initializing XFRM netlink socket
    [ 2.282793] NET: Registered protocol family 10
    [ 2.289327] Segment Routing with IPv6
    [ 2.293282] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [ 2.300613] NET: Registered protocol family 17
    [ 2.305334] NET: Registered protocol family 15
    [ 2.310171] Key type dns_resolver registered
    [ 2.314766] omap_voltage_late_init: Voltage driver support not added
    [ 2.321431] sr_dev_init: Unable to get voltage domain pointer for VDD core
    [ 2.328655] sr_dev_init: Unable to get voltage domain pointer for VDD mpu
    [ 2.335981] Power Management for TI OMAP4+ devices.
    [ 2.341401] ThumbEE CPU extension supported.
    [ 2.345932] Registering SWP/SWPB emulation handler
    [ 2.350964] SmartReflex Class3 initialized
    [ 2.363933] ata1: SATA link down (SStatus 0 SControl 300)
    [ 2.402404] omap_hsmmc 4809c000.mmc: could not find pctldev for node /ocp/padconf@4844a000/mmc1_iodelay_ddr50_conf, deferring probe
    [ 2.415535] omap_hsmmc 480ad000.mmc: could not find pctldev for node /ocp/padconf@4844a000/mmc3_iodelay_manual1_conf, deferring probe
    [ 2.429289] hctosys: unable to open rtc device (rtc0)
    [ 2.434669] sr_init: No PMIC hook to init smartreflex
    [ 2.440210] sr_init: platform driver register failed for SR
    [ 2.447058] aic_dvdd_fixed: disabling
    [ 2.450952] vmmcwl_fixed: disabling
    [ 2.455207] ldousb: disabling
    [ 2.458872] pbias_mmc_omap5: disabling
    [ 2.467970] Waiting for root device PARTUUID=50e41a45-02...
    [ 2.547835] mmc0: new DDR MMC card at address 0001
    [ 2.554502] mmcblk0: mmc0:0001 S10004 3.56 GiB
    [ 2.559731] mmcblk0boot0: mmc0:0001 S10004 partition 1 4.00 MiB
    [ 2.566508] mmcblk0boot1: mmc0:0001 S10004 partition 2 4.00 MiB
    [ 2.573230] mmcblk0rpmb: mmc0:0001 S10004 partition 3 4.00 MiB
    [ 2.581435] mmcblk0: p1 p2 p3
    [ 2.589872] omap_hsmmc 4809c000.mmc: could not find pctldev for node /ocp/padconf@4844a000/mmc1_iodelay_ddr50_conf, deferring probe
    [ 2.602961] omap_hsmmc 480ad000.mmc: could not find pctldev for node /ocp/padconf@4844a000/mmc3_iodelay_manual1_conf, deferring probe

    and no further information comes to the console.

  • This is looking like it is an AM5728 PCI/e issue.

    I ran a couple of tests based on suggestions I got from the Linux USB group.

    I have no failures using the native USB hosts which will run the same or similar xhci_hc code as the TUSB7340 will.

    I got a hold of a TI TUSB7340 EVM card and tested it in a PC running Linux and again had no problems. This should also be running the same xhci_hc code.

    So given the failure occurs for two different PCIe USB hosts, it looks like the problem lies in the PCI/e area at this point.

    Any advice on how to proceed? Also note, it looks like the 4.12 and 4.13 kernels have not been patched or fully patched yet for the AM5728 PCI changes that I see in the older kernels.
  • Hi, Chris,

    We'll need to get the PCie USB to try. Can you provide the µPD720201 usb card info so we get the exact the same one as yours?

    I found this one on internet, www.amazon.com/.../B008IPXOWU

    Do you use Realtek RTL8153 www.amazon.com/.../B01AXP48PE for USB to Ethernet?


    Rex
  • Hi, Chris,

    What's the main purpose of using a PCIe to USB, then USB to Ethernet connection? We tested PCIe to Ethernet and PCIe to USB as storage. Can you use a PCIe Ethernet card instead? or if USB 3.0, can't you use the usb port on AM5728 EVM? or PCIe USB as storage?

    Rex
  • We are using a mini PCIe that can be directly plugged into the AM5728 EVM LCD miniPCIe slot. It looks like a generic board that gets rebranded.

    The specific one got is the Syba FG-MU303A.

    I think we sourced it from Amazon here in Canada as this is the card:

    www.amazon.ca/.../ref=sr_1_1

    I don't think the USB Ethernet adapter is critcal as it fails also with an Asus adapter I have. But specifically for our test uses a R8153 based adapter. It is a generic product, Iocrest IO-USB153D-GLAN. The dmesg indicates r8152, but I'm fairly confident it is R8153 and should be this one:

    www.amazon.ca/.../B00NJF1IC2

    [ 77.676056] usb 2-1.1.2: Manufacturer: Realtek
    [ 77.676064] usb 2-1.1.2: SerialNumber: 0050C5000464
    [ 77.768842] usbcore: registered new interface driver r8152
    [ 77.779362] usbcore: registered new interface driver cdc_ether
    [ 77.868984] usb 2-1.1.2: reset SuperSpeed USB device number 4 using xhci-hcd
    [ 77.962181] r8152 2-1.1.2:1.0 eth2: v1.08.8
    [ 77.989869] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready

    Otherwise if it would help, we can ship these items to you. Let me know.

    Thanks for looking into this.
  • The reason the test has to be via the PCIe USB host is that we require USB ports on the back plane of our product that are serviced with the TUSB7340.

    We have utilized the native USB hosts on the AM5728 with three TUSB8041 hubs.

    I'm not with the H/W group, but my understanding is the TUSB7340 was used on the back plane due to connectivity and bandwidth requirements.

    They don't want the 8 backplane ports serviced via a chained hub, they want it dedicated. So four ports are serviced via one TUSB8041 to a dedicated AM5728 USB host and the four remaining ports are serviced via the TUSB7340.

    The product is fully laid out and the first prototype is now built now so it will be expensive to rework at this point.

    The USB Ethernet adapter usage isn't a requirement. It is just a simple way to replicate the problem.

    We get the same TUSB7340 host crash transferring data with our USB based products we have plugged into the backplane. They are cdc_ethernet based implementations.
  • Chris,

    Thanks for the info. I'll try to get the exact same ones to replicate your setup. It may take a few days before I get the equipment. I'll post back with our progress.

    Rex

  • Kernel already has the patches, insufficient information to try the 4.13 kernel.
  • Any update on this?
  • Ignore the most recent 4.13 kernel comment, it is out of sequence due to the way the application works. The 4.13 kernel as I mentioned fails after the first packet and 4.12 and 4.13 appear to be missing PCIe patches such as the i870 work around.
  • Hi, Chris,

    I just got both equipment yesterday, and am trying to bring up the Realtek 8153. I just got the linux driver downloaded and need to cross-compile it.

    Rex
  • Great, thanks for the update, looking forward to your results. I just used the built in Realtek driver via the kernel configuration:

    Kernel Configuration/Device Drivers/Network device support/USB Network Adapters and the Realtek is listed about 5 lines down
  • I was looking under Ehternet driver support earlier but couldn't find driver for realtek8153, so I downloaded the driver package. Then, I saw that one of the error messages you posted earlier was printed in usb/r8152.c which made me think it should be under usb driver. Thanks for the info. It confirms my thought. I checked the realtek8153 is built as module. I'll try with the prebuilt image to see if I get the port up. I am using Kernel 4.9 from ProcSDK 4.0.0.4.

    Rex
  • No troubles, finding stuff in the kernel configs can be a nightmare even when you know what you are looking for.

    I'm building with the Realtek as a loadable module as well.

    I'll run a test specifically with the 4.0.0.4 build I've got to see how it behaves. It was suggested that I move to a newer version so most of my testing has been with 4.9.45-ti-r57, 4.12 and 4.13 but I had done testing with the 4.0.0.4 4.9.28-geed43d1050 as well a while back. They all fail, just sometimes it takes longer.
  • Hi, Chris,
    I only see the usb controller, but ifconfig doesn't show the rtl8153 port, only eth0 and eth1 from AM5728 EVM. Anything I missed when setting it up?

    root@am57xx-evm:~# lsmod | grep r8152
    r8152 35925 0
    usbcore 200102 4 xhci_pci,xhci_plat_hcd,r8152,xhci_hcd

    Rex
  • dhcp for some reason doesn't run on it automatically.

    I worked around this by statically configuring the interface.

    ifconfig enp1s0u4 up
    ifconfig enp1s0u4 10.14.21.74 netmask 255.255.254.0 up
    route add default gw 10.14.21.1 enp1s0u4
  • ifconfig -a should show the interface, but I don't see it. I wonder if something I need to enable in menuconfig. I saw under USB3 DRD Core support has an option of PCIe-based platform. I wonder if I should have it enabled.

    Rex
  • Give me an hour and I'll get mine setup with the 4.0.04 and get the recipe to you.
  • Actually, I'd left my EVM with this setup, so I'm aligned with you.

    If you are not seeing it in ifconfig -a my recollection was that the driver wasn't loading and yes, I seem to recall a USB3 setting of some sort.

    Unfortunately the .config file is 5K lines so I can't post it. Is there some way I can email it to you or by some other means?

    I'll have a look through my notes and the config and see if I can recall what the other setting was. My recollection is that I actually did the one that is missing first and the Realtek driver second when I was figuring out how to get it to work.

    Here is the results of my test which should be aligned with you once you get it going.

    root@am57xx-evm:~/iperf-3.1.3/src# uname -a
    Linux am57xx-evm 4.9.28-geed43d1050 #2 SMP PREEMPT Wed Jun 28 18:16:59 EDT 2017 armv7l GNU/Linux

    I do an ifconfig:

    root@am57xx-evm:~# ifconfig -a
    enp1s0u4 Link encap:Ethernet HWaddr 00:50:C5:00:04:64
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    eth0 Link encap:Ethernet HWaddr FC:0F:4B:7A:F0:EA
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:101

    eth1 Link encap:Ethernet HWaddr FC:0F:4B:7A:F0:EB
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1%763860/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:160 errors:0 dropped:0 overruns:0 frame:0
    TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:12160 (11.8 KiB) TX bytes:12160 (11.8 KiB)

    sit0 Link encap:IPv6-in-IPv4
    NOARP MTU:1480 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    I do the ifconfig setup commands (first isn't required, I had done it to get it visible in ifconfig when I was first working with it):

    ifconfig enp1s0u4 up
    ifconfig enp1s0u4 10.14.21.74 netmask 255.255.254.0 up
    route add default gw 10.14.21.1 enp1s0u4

    and I run iperf3 (you'll need to get a copy and build it):

    root@am57xx-evm:~/iperf-3.1.3/src# ./iperf3 -c 10.14.21.95 -t 6000
    Connecting to host 10.14.21.95, port 5201
    [ 4] local 10.14.21.74 port 55204 connected to 10.14.21.95 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 2.99 MBytes 25.0 Mbits/sec 1 1.41 KBytes
    [ 4] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 188.719630] xhci_hcd 0000:01:00.0: xHCI host not responding to stop endpoint command.
    [ 188.727502] xhci_hcd 0000:01:00.0: Assuming host is dying, halting host.
    [ 188.738754] r8152 2-4:1.0 enp1s0u4: Tx status -108
    [ 188.743575] r8152 2-4:1.0 enp1s0u4: Tx status -108
    [ 188.748391] r8152 2-4:1.0 enp1s0u4: Tx status -108
    [ 188.753205] r8152 2-4:1.0 enp1s0u4: Tx status -108
    [ 188.758038] xhci_hcd 0000:01:00.0: HC died; cleaning up
    [ 4] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 K[ 188.763355] usb 2-4: USB disconnect, device number 2
    Bytes
    [ 4] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 10.00-11.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    ^C[ 4] 11.00-11.09 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval Transfer Bandwidth Retr
    [ 4] 0.00-11.09 sec 2.99 MBytes 2.26 Mbits/sec 1 sender
    [ 4] 0.00-11.09 sec 0.00 Bytes 0.00 bits/sec receiver
    iperf3: interrupt - the client has terminated

    The host fails after the first data set is done.
  • I did a diff between my .config and the tisdk_am57xx-evm_defconfig and there are no differences. I checked with git status and I haven't made any changes to the default config.

    You should be able to get things working with the stock default configuration.

    My notes say I just did a make linux in ti-processor-sdk-linux-am57xx-evm-04.00.00.04 to build it.
  • If I plugged the USB-Ethernet adapter to the AM57x USB port directly, it is detected and things work fine. So, the adapter is working. If it is plugged to the USB host controller card via a type A-USB3.0 MicroB cable, it isn't detected. That makes me wonder if it is the cable causing issue. That's how your set up is, correct? It is a 20-pin connector on the Syba host controller and type-A Femaile on the other end which connects to a type-A Male with USB 3.0 micro B on the other end to the Ethernet adapter.
  • I did a stock build for the EVM, make clean, make linux from the top of the SDK tree.

    root@am57xx-evm:~# lspci
    00:00.0 PCI bridge: Texas Instruments Multicore DSP+ARM KeyStone II SOC (rev 01)
    01:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

    The Realtek initially didn't hot plug detect, I pulled the USB cables from the PCIe USB host card and plugged them back in and hot plug started working. Different port this time so it shows up on enp1s0u3 instead of enp1s0u4.

    root@am57xx-evm:~# lsusb
    Bus 003 Device 002: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
    Bus 004 Device 002: ID 0451:8140 Texas Instruments, Inc.
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 002: ID 0bda:8153 Realtek Semiconductor Corp.
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

    root@am57xx-evm:~# ifconfig -a
    enp1s0u3 Link encap:Ethernet HWaddr 00:50:C5:00:04:64
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    eth0 Link encap:Ethernet HWaddr FC:0F:4B:7A:F0:EA
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:97

    eth1 Link encap:Ethernet HWaddr FC:0F:4B:7A:F0:EB
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1%763860/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:270 errors:0 dropped:0 overruns:0 frame:0
    TX packets:270 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:222743 (217.5 KiB) TX bytes:222743 (217.5 KiB)

    sit0 Link encap:IPv6-in-IPv4
    NOARP MTU:1480 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


    ifconfig enp1s0u3 up
    ifconfig enp1s0u3 10.14.21.74 netmask 255.255.254.0 up
    route add default gw 10.14.21.1 enp1s0u3

    provisions it. And the iperf3 test fails as before.

    You should have to do anything special, just build and it should work.
  • Sounds the same. I have a PC power supply hooked up to the white four pin power connector as this is required to power any USB devices. You won't see anything if you don't provide power to the white four pin power connector.

    My most recent test required me to unplug and plug back in the cable harness to get the adapter detected. Other than that it should work.
  • I read the user manual and the step 7 of the hardware installation was to hook up power. I was wondering how earlier and didn't see anything for it. I thought the 4-pin connector is for uart or something and think if I am able to enumerate it, it should be fine. I think that is why I am not seeing anything. I'll give it a try tomorrow. Thanks!
  • Chris,

    I only reproduce the issue once using iperf 2.0.5, and can't cause it to fail either using iperf 2.0.5 or iperf3. I tired both TCP and UDP on iperf3 and it runs well.

    root@am57xx-evm:~# iperf3 -c 192.168.1.1 -b 600M -t 6000
    ::::::::::::
    [ 4] 3208.00-3209.00 sec 37.9 MBytes 318 Mbits/sec 0 397 KBytes
    [ 4] 3209.00-3210.00 sec 37.6 MBytes 316 Mbits/sec 0 397 KBytes
    [ 4] 3210.00-3211.00 sec 38.0 MBytes 319 Mbits/sec 0 397 KBytes
    [ 4] 3211.00-3212.00 sec 37.9 MBytes 318 Mbits/sec 0 397 KBytes

    root@am57xx-evm:~# iperf3 -c 192.168.1.1 -u -b 600M -t 6000
    ::::::::::::::::
    [ 4] 1987.00-1988.00 sec 37.4 MBytes 314 Mbits/sec 4787
    [ 4] 1988.00-1989.00 sec 37.4 MBytes 314 Mbits/sec 4786
    [ 4] 1989.00-1990.00 sec 37.4 MBytes 314 Mbits/sec 4788
    [ 4] 1990.00-1991.00 sec 37.3 MBytes 313 Mbits/sec 4780

    I recall when it failed the first time, ifconfig didn't show the port, but lspci still had Renesas PCIe device. I am not convinced it's PCie issue, but without being able to reproduce it, I can't exam it further.

    Is there any tricks to get it happened easily, such as power up sequence,etc.? I reboot the EVM from kernel prompt and also tried power cycled the EVM, but none makes any difference.

    Rex
  • No special power sequences or tricks required. I have the power to the USB host on prior to board power up.

    I tried the different usage you have:

    root@am57xx-evm:~/iperf-3.1.3/src# ./iperf3 -c 10.14.21.95 -b 600M -t 6000
    Connecting to host 10.14.21.95, port 5201
    [ 4] local 10.14.21.75 port 39018 connected to 10.14.21.95 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 4.36 MBytes 36.6 Mbits/sec 1 1.41 KBytes
    [ 4] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes

    but it still fails.

    Let it run for a while. It took an hour to an hour and a half to fail with the 4.4.x kernel on our prototype board. A couple of other test setups it would go for a minute or two then die.

    I can't explain why it would be different for you. It consistently fails right away on the EVM for me.

    It isn't data/network dependent as I can lock out the controller on our product by doing data transfers with our USB 2.0 based products.

    I'll try some testing with the stock EVM SD card in case there is something in the overall card I have that might be causing the difference.

    Is there any way I can get a copy of your SD card image?
  • So I just built a fresh SD card from the SDK using bin/create-sdcard.sh

    I use the 2 partition selection and install pre-built images from the SDK. The card has absolutely no modifications or changes from the stock SD image built by bin/create-sdcard.sh

    I get a copy of iperf-3.1.3-source.tar.gz, I extract it, run configure, then I run make.

    I then run iperf3 and I get an immediate failure. I have run this test on all 4 of the USB ports on the uPD720201 host and all fail the same way:

    root@am57xx-evm:~/iperf-3.1.3/src# ./iperf3 -c 10.14.21.95 -t 6000
    Connecting to host 10.14.21.95, port 5201
    [ 4] local 10.14.21.75 port 40444 connected to 10.14.21.95 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 5.65 MBytes 47.3 Mbits/sec 1 1.41 KBytes
    [ 4] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 518.799930] xhci_hcd 0000:01:00.0: xHCI host not responding to stop endpoint command.
    [ 518.807802] xhci_hcd 0000:01:00.0: Assuming host is dying, halting host.
    [ 518.819697] r8152 2-3:1.0 enp1s0u3: Tx status -108
    [ 518.824515] r8152 2-3:1.0 enp1s0u3: Tx status -108
    [ 518.829330] r8152 2-3:1.0 enp1s0u3: Tx status -108
    [ 518.834144] r8152 2-3:1.0 enp1s0u3: Tx status -108
    [ 518.838978] xhci_hcd 0000:01:00.0: HC died; cleaning up
    [ 518.851969] usb 2-3: USB disconnect, device number 2
    [ 4] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    ^C[ 4] 6.00-6.40 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval Transfer Bandwidth Retr
    [ 4] 0.00-6.40 sec 5.65 MBytes 7.40 Mbits/sec 1 sender
    [ 4] 0.00-6.40 sec 0.00 Bytes 0.00 bits/sec receiver
    iperf3: interrupt - the client has terminated

    I've tested the USB Ethernet adapter with the native USB host ports and never have a failure.

    Same failure on our production board, but it uses a TUSB7340 PCIe USB host. The only time we get USB host failures is with the PCIe based USB host.

    I've also replicated this same failure on two TI AM5728 EVMs.

    Any suggestions?
  • Hi, Chris,

    I am pretty much on the same page as you now, and can reproduce the issue consistently. I probably hit one of the lucky moments earlier that everything flies smoothly. I noticed that the iperf shows no packets transmitted at sec 2 before USB driver complains not responding. I am puzzled why no packets out, but can't exclude PCIe. All info points to the only variable in the tests is the PCIe. I'll see if I can diagnose the PCIe to see why.

    Rex
  • Great, thanks much.

    Let me know if there is anything else I can do to help with your investigation.
  • Chris,

    While I am waiting for internal response, I tried with TUSB73x0 USB 3.0 Host controller which I happen to have.

    www.siig.com/.../dp-usb-3-0-4-port-pcie-i-e.html

    I tried reset the system twice and have not been able to hit the issue. I'll try to see if I can make it to happen before I leave for the day, and leave it to run overnight if it doesn't happen. I'll see what I get from it.

    Rex
  • How do you hook up this board? I've got the TI TUSB7340 EVM and tried an adapter interface, but it wasn't stable enough to run reliably even at GEN1. I was able to determine the failures were due to PCI electrical issues, not the USB host becoming locked out.

    The TUSB7340 does last longer on our production and prototype boards, but it eventually fails with the same xhci_hcd host died failure. I just ran a test (4.9.45 kernel) and it died after 90 seconds:

    [ 4] 93.00-94.00 sec 23.4 MBytes 196 Mbits/sec 0 725 KBytes
    [ 4] 94.00-95.00 sec 23.3 MBytes 195 Mbits/sec 0 725 KBytes
    [ 4] 95.00-96.00 sec 10.2 MBytes 85.3 Mbits/sec 1 1.41 KBytes
    [ 4] 96.00-97.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 97.00-98.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 98.00-99.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    iperf3: interrupt - the client has terminated
    root@arm:~# [ 4284.105536] xhci_hcd 0001:07:00.0: HC died; cleaning up

    I'll run a test with the SDK kernel and see if the behaviour is any different.
  • I have a mini-pcie-to-pcie extension adapter card in the mini-pcie connector on AM5728 EVM, It doesn't need external power.

    www.amazon.com/.../ref=pd_lpo_vtph_147_tr_t_2

    Then, have the SIIG USB 3.0 host controller plugged into the PCIe connector on mini-pcie to pcie extension adapter. I need to provide external power for this SIIG card through SATA connector. This USB controller is shown as TI TUSB73x0 USB host controller in lspci.

    www.amazon.com/.../ref=sr_1_1

    From the USB port of SIIG card, I connect the USB-to-Ethernet adapter.

    I have restarted the system 5-6 times including power down, reboot, etc. and iperf3 runs more than 5 minutes each time. I have not seen a single failure yet. The last run is more than 10 mins. I also noticed the bandwidth through this USB host controller is higher at ~500Mbps. I recall inall the failed cases, the bandwidth are all shown less than 100Mbps. When I first started without failure, the bandwidth was around 300Mbps. Let's see if SIIG USB card works better without failure. That may indicates packets backed up at the USB which may have hogged resources to cause the failure.

    [ 4] 682.00-683.00 sec 60.5 MBytes 507 Mbits/sec 0 609 KBytes
    [ 4] 683.00-684.00 sec 60.6 MBytes 509 Mbits/sec 0 609 KBytes
  • Tested with the SDK kernel 4.9.28-geed43d1050 on our production board with the TUSB7340 and it failed around a minute into the test:

    [ 4] 64.00-65.00 sec 23.2 MBytes 195 Mbits/sec 0 477 KBytes
    [ 4] 65.00-66.00 sec 22.8 MBytes 191 Mbits/sec 0 477 KBytes
    [ 4] 66.00-67.00 sec 23.3 MBytes 195 Mbits/sec 0 477 KBytes
    [ 4] 67.00-68.00 sec 13.8 MBytes 116 Mbits/sec 1 1.41 KBytes
    [ 4] 68.00-69.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 69.00-70.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 70.00-71.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    [ 4] 71.00-72.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
    iperf3: interrupt - the client has terminated
    ^Croot@arm:~/omapdrm-tests# [ 733.129356] xhci_hcd 0001:07:00.0: HC died; cleaning up
  • I am also on 4.9.28 kernel. I just started up mine.

    root@am57xx-evm:~# uname -a
    Linux am57xx-evm 4.9.28-geed43d1050 #2 SMP PREEMPT Tue Sep 26 15:24:52 EDT 2017 armv7l GNU/Linux
    root@am57xx-evm:~# ifconfig -a
    enp1s0u2 Link encap:Ethernet HWaddr 00:E0:4C:68:1A:3B
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

    01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) (prog-if 30 [XHCI])
    Flags: bus master, fast devsel, latency 0, IRQ 439
    Memory at 20200000 (64-bit, non-prefetchable) [size=64K]
    Memory at 20210000 (64-bit, non-prefetchable) [size=8K]
    Capabilities: [40] Power Management version 3
    Capabilities: [48] MSI: Enable+ Count=1/8 Maskable- 64bit+
    Capabilities: [70] Express Endpoint, MSI 00
    Capabilities: [c0] MSI-X: Enable- Count=8 Masked-
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [150] Device Serial Number 08-00-28-00-00-20-00-00
    Kernel driver in use: xhci_hcd
    Kernel modules: xhci_pci

    root@am57xx-evm:~# ifconfig enp1s0u2 192.168.1.11 netmask 255.255.255.0
    [ 49.361287] IPv6: ADDRCONF(NETDEV_UP): enp1s0u2: link is not ready
    root@am57xx-evm:~# [ 49.387678] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0u2: link becomes ready

    root@am57xx-evm:~#

    The throughput is higher at ~510Mbps vs yours at ~190Mbps, and passed 2 mins and going.

    root@am57xx-evm:~# iperf3 -c 192.168.1.1 -t 6000
    Connecting to host 192.168.1.1, port 5201
    [ 4] local 192.168.1.11 port 42412 connected to 192.168.1.1 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 60.6 MBytes 508 Mbits/sec 0 223 KBytes

    [ 4] 119.00-120.00 sec 60.8 MBytes 510 Mbits/sec 0 448 KBytes
    [ 4] 120.00-121.00 sec 60.8 MBytes 510 Mbits/sec 0 448 KBytes
    [ 4] 121.00-122.00 sec 61.0 MBytes 511 Mbits/sec 0 448 KBytes

    I'll leave it to run overnight.

    Rex
  • The USB ports our TUSB7340 is connected to are limited to USB 2.0 causing the speed difference. However, this isn't the problem as I've crashed the host using a USB 2.0 based Ethernet adapter and our custom USB products as well. The host failure occurs with very low bandwidth data transfers.