From nobody Tue Sep 24 22:58:54 2024 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 4XCwJt56Wgz5WC88; Tue, 24 Sep 2024 22:58:54 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCwJt3hCxz4HKQ; Tue, 24 Sep 2024 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727218734; 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=W9tz3en01QB4CMDC3Pr+jmul2FrI7CUBwKuAFV7GOME=; b=N/8xuBptS5ePoM+f2Pn9SxTxdBVoiDVW0DQTV5hezzyLJqj3FfZhu0Y4SHfqYjQcNa1zuT xGjVi2HD86JlbwDVJ0BVAm9ljKeEA84hWf0zCcHDPJ7TKjnxOigqSKWrLCnd3ukyVTOIo5 xRdgXPMWpfb4Ea56hr+KO6tbr9LZEreHLbdNbIS0m7gS4A+WfaQRwLqZHHer7RkBI7xR/h vNoH7EKxjPOKdjaxWvGaxFW6lKsSmeoYffz4z61Wt3qPvYf3CCKlc92aIDZyWpZp+5Ttjv 2kK4xFp436crxDPW8GbbHloxbfF1aclHeZhYaTAUlhazTKCskNdG6YYej+Pf0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727218734; a=rsa-sha256; cv=none; b=gzP/gkknpCcL8xozLmzzrmdIsGD3BWRHpSUYDgyb0979r4P+5IVoTUnprKnRImLHWl3xXz hbq7Y51oIzyJsoHpRPMTi9BbkNBfhklwa3UfdQMuRFDNZ5z/+ReWdmUVW1xgIQYZyrDrcf ePGLBmixcXtJWIS54AkCtZgrLi6XmJSpKZpasWVpM9kWWEvGNX006dg/5eiNxdmm+XDIOQ +r1v+IntmSbEZ9o/mgEvAaznB8Ttu2m35S8SGccj+C7iRtZyVt9IPz8FOfNHNLjN8ZIgka wfwjvwu2klMpPZpy0lwx9px4YR3yC/LkVvwlMEJKZr7HMf7bkuvg9eURmsKwfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727218734; 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=W9tz3en01QB4CMDC3Pr+jmul2FrI7CUBwKuAFV7GOME=; b=TmxN+YMSw0HyeLKpWqWh3A/fHF42VP6svavywgGTZnwXb8hI9t4LiY5t3g+Eh3Nin8m7zI y/ikOs9zojgLXasZCo0oYVw9HMtYb8KRcZX2BfdWr6QehzUNTkr/HHdGd/kQHKHjruyfhn Om7g68AUOjGbnDtrkfgMdqDw1hpX5JD0bOKXKnXSHOEAd/VGqMYbOCQwv8S+N7RgGUaJQd 3Z+JmI98J4bav6E9azRWkWu9dDAZN8On1UHThtGQTqHC7PLiTOB0Wb8iGNCNGDgXj9felm tcXvMbMC/r/qD+jQAVq6y7Gkn7SS9uDYdLpodm4XJUt0K1AnyAa23cfyS7gcyw== 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 4XCwJt3GnHznlH; Tue, 24 Sep 2024 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OMws92073681; Tue, 24 Sep 2024 22:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OMwspv073678; Tue, 24 Sep 2024 22:58:54 GMT (envelope-from git) Date: Tue, 24 Sep 2024 22:58:54 GMT Message-Id: <202409242258.48OMwspv073678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5b8f97d8db82 - main - usb: change LIST to SLIST to avoid LinuxKPI conflicts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8f97d8db82e031c409d29313939423b7aac2cb Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8f97d8db82e031c409d29313939423b7aac2cb commit 5b8f97d8db82e031c409d29313939423b7aac2cb Author: Bjoern A. Zeeb AuthorDate: 2024-09-04 19:21:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 22:53:28 +0000 usb: change LIST to SLIST to avoid LinuxKPI conflicts In order to better integrate modern LinuxKPI USB this tries to reduce a contention point of "LIST". Given there is no need to use a LIST here change it to SLIST to avoid conflicts. It is a workaround which does not solve the actual problem (overlapping namespaces) but it helps us a lot for now. Sponsored by: The FreeBSD Foundation X-MFC? unclear Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46534 --- sys/dev/usb/controller/usb_controller.c | 6 +++--- sys/dev/usb/usb_bus.h | 2 +- sys/dev/usb/usb_dev.h | 2 +- sys/dev/usb/usb_device.c | 14 +++++++------- sys/dev/usb/usb_device.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 838bd6bf7621..d717ad56adea 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -653,8 +653,8 @@ usb_bus_cleanup(struct usb_proc_msg *pm) bus = ((struct usb_bus_msg *)pm)->bus; - while ((pd = LIST_FIRST(&bus->pd_cleanup_list)) != NULL) { - LIST_REMOVE(pd, pd_next); + while ((pd = SLIST_FIRST(&bus->pd_cleanup_list)) != NULL) { + SLIST_REMOVE(&bus->pd_cleanup_list, pd, usb_fs_privdata, pd_next); USB_BUS_UNLOCK(bus); usb_destroy_dev_sync(pd); @@ -847,7 +847,7 @@ usb_attach_sub(device_t dev, struct usb_bus *bus) bus->shutdown_msg[1].bus = bus; #if USB_HAVE_UGEN - LIST_INIT(&bus->pd_cleanup_list); + SLIST_INIT(&bus->pd_cleanup_list); bus->cleanup_msg[0].hdr.pm_callback = &usb_bus_cleanup; bus->cleanup_msg[0].bus = bus; bus->cleanup_msg[1].hdr.pm_callback = &usb_bus_cleanup; diff --git a/sys/dev/usb/usb_bus.h b/sys/dev/usb/usb_bus.h index b9197d3cd84a..ad7b661c2ac0 100644 --- a/sys/dev/usb/usb_bus.h +++ b/sys/dev/usb/usb_bus.h @@ -86,7 +86,7 @@ struct usb_bus { struct usb_bus_msg shutdown_msg[2]; #if USB_HAVE_UGEN struct usb_bus_msg cleanup_msg[2]; - LIST_HEAD(,usb_fs_privdata) pd_cleanup_list; + SLIST_HEAD(,usb_fs_privdata) pd_cleanup_list; #endif /* * This mutex protects the USB hardware: diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index 08ceb2555942..381fa1654c95 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -96,7 +96,7 @@ struct usb_fs_privdata { int fifo_index; struct cdev *cdev; - LIST_ENTRY(usb_fs_privdata) pd_next; + SLIST_ENTRY(usb_fs_privdata) pd_next; }; /* diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index dd571fcef299..0f3c6a959ad2 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1880,7 +1880,7 @@ usb_alloc_device(device_t parent_dev, struct usb_bus *bus, snprintf(udev->ugen_name, sizeof(udev->ugen_name), USB_GENERIC_NAME "%u.%u", device_get_unit(bus->bdev), device_index); - LIST_INIT(&udev->pd_list); + SLIST_INIT(&udev->pd_list); /* Create the control endpoint device */ udev->ctrl_dev = usb_make_dev(udev, NULL, 0, 0, @@ -2190,7 +2190,7 @@ usb_destroy_dev(struct usb_fs_privdata *pd) delist_dev(pd->cdev); USB_BUS_LOCK(bus); - LIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); + SLIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); /* get cleanup going */ usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->cleanup_msg[0], &bus->cleanup_msg[1]); @@ -2207,7 +2207,7 @@ usb_cdev_create(struct usb_device *udev) int inmode, outmode, inmask, outmask, mode; uint8_t ep; - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); DPRINTFN(2, "Creating device nodes\n"); @@ -2254,7 +2254,7 @@ usb_cdev_create(struct usb_device *udev) mode, UID_ROOT, GID_OPERATOR, 0600); if (pd != NULL) - LIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); + SLIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); } } @@ -2265,10 +2265,10 @@ usb_cdev_free(struct usb_device *udev) DPRINTFN(2, "Freeing device nodes\n"); - while ((pd = LIST_FIRST(&udev->pd_list)) != NULL) { + while ((pd = SLIST_FIRST(&udev->pd_list)) != NULL) { KASSERT(pd->cdev->si_drv1 == pd, ("privdata corrupt")); - LIST_REMOVE(pd, pd_next); + SLIST_REMOVE(&udev->pd_list, pd, usb_fs_privdata, pd_next); usb_destroy_dev(pd); } @@ -2358,7 +2358,7 @@ usb_free_device(struct usb_device *udev, uint8_t flag) mtx_destroy(&udev->device_mtx); #if USB_HAVE_UGEN - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); #endif /* Uninitialise device */ diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 3fc5efb049fc..87596cc1d2bd 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -225,7 +225,7 @@ struct usb_device { struct usb_fifo *fifo[USB_FIFO_MAX]; struct usb_symlink *ugen_symlink; /* our generic symlink */ struct usb_fs_privdata *ctrl_dev; /* Control Endpoint 0 device node */ - LIST_HEAD(,usb_fs_privdata) pd_list; + SLIST_HEAD(,usb_fs_privdata) pd_list; char ugen_name[20]; /* name of ugenX.X device */ #endif usb_ticks_t plugtime; /* copy of "ticks" */