From nobody Wed Oct 12 15:54:23 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mncf82ryHz4fdT7; Wed, 12 Oct 2022 15:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mncf81Dxgz3HDF; Wed, 12 Oct 2022 15:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665590064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHu3kwLx6sRLmdEN76vv6vJ5CzyVGX9oWuO8nJwqNV4=; b=a218O714eVSsl+RbNwxxwnxJlidl4595Ht5OLirj6NRObOJY2xfY1t3YnOICmSM3eQhPlY f0NEpXxDehvJ1VNhWhx4FymLF1QxQTuelIw3BNCOqIK1PZ5A0WDZhXHKLniEMsUpsPG7d7 tDUrLNie2fkaxNhm2qmCDdBhqbMt2rWjJyZ2EK9D/ucKNYthM2/o8eoA42zEiipR6JYXg1 k+D5U3FN7pMkWmv19U3KvJoES4vVv5CfVl2oLMR8mQIZ7mmfsmbsJvOHKpjMhsCD6OoAPV zXIPjvkla6/VuY0cs813XUdFozlfyZU3HgbAFWLZk3u2+X9VqzSXYCML9PPLZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mncf80LjKz1MD3; Wed, 12 Oct 2022 15:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29CFsNVR044014; Wed, 12 Oct 2022 15:54:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29CFsN2L044013; Wed, 12 Oct 2022 15:54:23 GMT (envelope-from git) Date: Wed, 12 Oct 2022 15:54:23 GMT Message-Id: <202210121554.29CFsN2L044013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 38b1cbc87b5f - stable/13 - usb(4): Make the enumeration thread nice time a variable. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38b1cbc87b5faefec38a81c4487877fde778be20 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665590064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHu3kwLx6sRLmdEN76vv6vJ5CzyVGX9oWuO8nJwqNV4=; b=XwqejIshv8y8fD/iEgR0jm6uBwLrbRzKMmsU7mJwyVDCPJV28c9Yo8rhbWcIYWqj1sWlz6 oeL0qBjCSXaX1Ydn4RQpKmgrfeOVy4CqhconNuXz5aTDsPg/KHkbI6wcUbBVFxCAacVdTN I9IouZPrsmbJyqUcgg+vo9Op+aDeYBO00DNd34XMwdj68AxtIsh1Fzgw8zRPys+FMBMDrq 2sXXYtmB9OJFRKHLLxBa5Z5jpe12LikMFdbAC03JBaNgIVgmpUnTZLCeBI7JJktw2Vh6Wf q9DefxqacxTflmn+neLymSuRUduqVCWk+2Nc0xm5L10rpdN40zJQlG6wDvxiyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665590064; a=rsa-sha256; cv=none; b=BXnnFikwTaJL4Y+gjuCxxgGA9xLoHT8fXY4jkICnQLYVzaNQ53Siy/5KFoomg1QbC2rgnC TMyYjpMPpGHF0JfBfNoFrZPZFZWf5fRFFn4ydHea7aiiG+7bYKzRlk2EqFs5QV1uf2rmzK jd1w2FC9zlARbj3IBJsoDHrvF6mZnbpBismqoCHWwggYC6OXAoxhaZ5hCrX90149HkmcV9 xDzVxwU4TSrxzGnNazrHzKvxOFnGZUWPG5cOBtTgvx0Ygw0BhxWO3hmM6QmSlOOF9YwmLX e05aBt6G8SE8uxdTWwAAOABOIg7irNh59TkGt9ge4bZRZ9VDbnF0DZgVSs5PoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=38b1cbc87b5faefec38a81c4487877fde778be20 commit 38b1cbc87b5faefec38a81c4487877fde778be20 Author: Hans Petter Selasky AuthorDate: 2022-10-07 11:28:38 +0000 Commit: Hans Petter Selasky CommitDate: 2022-10-12 15:53:22 +0000 usb(4): Make the enumeration thread nice time a variable. Depends on "options USB_DEBUG". Suggested by: koobs@ Sponsored by: NVIDIA Networking (cherry picked from commit 8758aabb169d98f08c20f2a1fce5184434b1ddf6) --- sys/dev/usb/controller/usb_controller.c | 2 +- sys/dev/usb/usb.h | 1 + sys/dev/usb/usb_debug.c | 7 ++++++- sys/dev/usb/usb_debug.h | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 8705c2849e4e..37f318ca98df 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -418,7 +418,7 @@ usb_bus_explore(struct usb_proc_msg *pm) #endif /* Nice the enumeration a bit, to avoid looping too fast. */ - usb_pause_mtx(&bus->bus_mtx, USB_MS_TO_TICKS(16)); + usb_pause_mtx(&bus->bus_mtx, USB_MS_TO_TICKS(usb_enum_nice_time)); } /*------------------------------------------------------------------------* diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index ad0381366f98..0bef7a10bc6c 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -123,6 +123,7 @@ MALLOC_DECLARE(M_USBDEV); #define USB_RESUME_WAIT 50 /* ms */ #define USB_RESUME_RECOVERY 50 /* ms */ #define USB_EXTRA_POWER_UP_TIME 20 /* ms */ +#define USB_ENUM_NICE_TIME 16 /* ms */ #define USB_MIN_POWER 100 /* mA */ #define USB_MAX_POWER 500 /* mA */ diff --git a/sys/dev/usb/usb_debug.c b/sys/dev/usb/usb_debug.c index 5e521f7ec3a5..6ad8dce9a037 100644 --- a/sys/dev/usb/usb_debug.c +++ b/sys/dev/usb/usb_debug.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2022 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -123,6 +123,10 @@ SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, &usb_extra_power_up_time, sizeof(usb_extra_power_up_time), usb_timings_sysctl_handler, "IU", "Extra PowerUp Time"); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, enum_nice_time, + CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, &usb_enum_nice_time, + sizeof(usb_enum_nice_time), usb_timings_sysctl_handler, "IU", + "Enumeration thread nice time"); #endif /*------------------------------------------------------------------------* @@ -245,6 +249,7 @@ unsigned int usb_resume_delay = USB_RESUME_DELAY; unsigned int usb_resume_wait = USB_RESUME_WAIT; unsigned int usb_resume_recovery = USB_RESUME_RECOVERY; unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME; +unsigned int usb_enum_nice_time = USB_ENUM_NICE_TIME; /*------------------------------------------------------------------------* * usb_timings_sysctl_handler diff --git a/sys/dev/usb/usb_debug.h b/sys/dev/usb/usb_debug.h index 87c0dcfe3d5f..3f25268629cf 100644 --- a/sys/dev/usb/usb_debug.h +++ b/sys/dev/usb/usb_debug.h @@ -72,6 +72,7 @@ extern unsigned int usb_resume_delay; extern unsigned int usb_resume_wait; extern unsigned int usb_resume_recovery; extern unsigned int usb_extra_power_up_time; +extern unsigned int usb_enum_nice_time; #else #define usb_port_reset_delay USB_PORT_RESET_DELAY #define usb_port_root_reset_delay USB_PORT_ROOT_RESET_DELAY @@ -83,6 +84,7 @@ extern unsigned int usb_extra_power_up_time; #define usb_resume_wait USB_RESUME_WAIT #define usb_resume_recovery USB_RESUME_RECOVERY #define usb_extra_power_up_time USB_EXTRA_POWER_UP_TIME +#define usb_enum_nice_time USB_ENUM_NICE_TIME #endif #endif /* _USB_DEBUG_H_ */