Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Sep 2022 15:54:12 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Ivan Quitschal <tezeka@hotmail.com>
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>, "freebsd-usb@FreeBSD.org" <freebsd-usb@FreeBSD.org>
Subject:   Re: RES: TP-LINK USB no carrier after speed test
Message-ID:  <5bf98c30-c00f-7e7a-3a3d-c0bd5862fb97@selasky.org>
In-Reply-To: <fd261e3f-ed98-1c48-2af2-943520acbf13@selasky.org>
References:  <CP6P284MB1900F16EDAEAF1CB485BC372CB499@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <7d14c045-81dc-fc08-4d62-69fb90a26edb@selasky.org> <9188fd1d-00ae-134b-488a-e75fbd152c98@selasky.org> <CP6P284MB1900A15CE4C38304F4925A60CB499@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <CP6P284MB1900CF5B403F7F8BE7DD5857CB499@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <de8c944a-59b7-1fb0-e8bf-0f4c31d95090@selasky.org> <5c9c47d6-9e12-ae76-ce67-15aeae1b8636@selasky.org> <11b7de01-d95e-5280-2a22-8b17e29c34c0@selasky.org> <CP5P284MB1902026EB918E88DE5581ACCCB489@CP5P284MB1902.BRAP284.PROD.OUTLOOK.COM> <5f646a9a-2885-05af-9ff1-ef4c4446f365@selasky.org> <CP5P284MB1902929145200C5BE706C789CB489@CP5P284MB1902.BRAP284.PROD.OUTLOOK.COM> <9c370afb-1931-f977-16a9-4915a82ec773@selasky.org> <CP5P284MB19020B7054012F9140E9D8F2CB489@CP5P284MB1902.BRAP284.PROD.OUTLOOK.COM> <CP6P284MB19005F8AF0CF964D011E8EA7CB4A9@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <fd261e3f-ed98-1c48-2af2-943520acbf13@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi Ivan,

Can you revert all if_ure patches, and try this one instead.

--HPS
[-- Attachment #2 --]
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 045be9a40b99..09aefb02687d 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -2848,8 +2848,16 @@ xhci_transfer_insert(struct usb_xfer *xfer)
 
 	/* check if already inserted */
 	if (xfer->flags_int.bandwidth_reclaimed) {
-		DPRINTFN(8, "Already in schedule\n");
-		return (0);
+		DPRINTFN(8, "Already in schedule (ringin doorbell only)\n");
+
+		/*
+		 * Apparently there may be a race with multi
+		 * buffering, that the hardware doesn't see the new
+		 * chain bit value and stops the endpoint
+		 * execution. Fix this by ringing the doorbell after
+		 * each and every job that has been completed.
+		 */
+		goto ring_doorbell;
 	}
 
 	pepext = xhci_get_endpoint_ext(xfer->xroot->udev,
@@ -2966,6 +2974,7 @@ xhci_transfer_insert(struct usb_xfer *xfer)
 
 	xfer->flags_int.bandwidth_reclaimed = 1;
 
+ring_doorbell:
 	xhci_endpoint_doorbell(xfer);
 
 	return (0);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5bf98c30-c00f-7e7a-3a3d-c0bd5862fb97>