From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F3BD348C70 for ; Thu, 11 Jun 2026 22:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781215874; cv=none; b=D51xpBs1+JEUzyLhbYTUw3L/hejSlADFwPpGj6J7zKU+Vro1saVnT5hZW/CmSYwpp0od7WvduyUGGVeJpjVrzCfSuLdAyCbkjDo92reEaOaaDlilOgmCLmjQxMALgMICZ/Oo2tVHqQWv9GrqL8BprxubYzVvMpgiJy4bj/VzTgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781215874; c=relaxed/simple; bh=Db/rTwmKYyYUA2cN2B39+KKMbD3gbRUp99qdLPL5iGk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=mO1TfBMiYcLnOCGfvqTh1OR9NFcTZbo87B+2j+motuy95qgTDLYFWpGNnHOtKABqFkUkNDZtpp6fTesxg4vjUYWw64KR9CjSHgpSLhbytt7BVw/KjivvbDw9fGPd/lOTu7bei1+IDO1W9zF1sNUpUTwW+6F0kOotTV6Cz3CKqXc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ynm95NYE; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ynm95NYE" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-68c5eecdd56so464580a12.3 for ; Thu, 11 Jun 2026 15:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781215872; x=1781820672; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=CoGMK7meFyOS/hZmcq5bwaafn9mYtDLX/gGPDytRZwo=; b=Ynm95NYEzbhXkw/IRoWriZ23CXBd/S0RwIdhR/G0N0LwHGYdciiAqxsasqgFKQuwil AxY3s35uN01powLCbmAxtlL8/iNwOo3UdHC2O2a7u32WwEuSRKVj4VfQlBpwvYV6eRLb /KUeVoJU5Mr4MHUIP9gIj858YTbTW3v9fmksOZDtmjSvSPiRFjREBDqXvn06/q4oE8lE Q80Yh6+9yvpPFy0KGSQuPxmN3xdMdsHv0fgp+FmgZkaocQ1nMNRJBXvwsFWIu4XspYue 9VdF+36SP4gAM9iqTJQNmOYBmsWZeEyOBfYPAPw/OrEbJtDVdgTnzHaGwQXnhXqJjAWS 3M6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781215872; x=1781820672; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CoGMK7meFyOS/hZmcq5bwaafn9mYtDLX/gGPDytRZwo=; b=e7loRwvsfSLrmQ/WlZ7VJanJUGK7M8uVyaKjnpzSVlddkFWoo8z4v8HYi3gETDtkSp YlOJ70QgG7uOz7hAcrs60pFcjiurN//LtpgUbvkh3bollbymfbZC1vGte/1ClQ8EZd+H 7ePt1NU7C5fql8u5ZJH+gdT4G9UggTTPhU20cS/LhHbfWZt2WuS0Z99/wyC/USqwdKpi c9aBqCeoNb+3G3aIntNyEAULhdAJRYZPF0jWpqluS2q2fTPa/jdFcI6oXPS6ZVWmZ22m q8jaIK2pR3LKTVly33/nwj8LHaMajctCRbHxASazvgUaTBXupNW2ohIKCl0Y07LQ8BtV kt1w== X-Forwarded-Encrypted: i=1; AFNElJ+P9klZGxSXt44Qzsz+rbFPULE9nC4sk1IogE2NzZmtmdpZXEaqhLwRZKQC8F2SyLU9bqN8iPKHa5CgFTU=@vger.kernel.org X-Gm-Message-State: AOJu0YzqCA2C+ZTKzkEApgYU3kc/rHXd3O//XYU4B8MCfDeunn9Jlw2N +BPRNWu7f4SRygBx2r6m7rRN5aS4PVYyuVtlMWXO8y/6KOCcuKHmNB6b X-Gm-Gg: Acq92OF0rQrUwsZo1D6k3amI2d2ENL9EkKu231OohUFXV423ed434tdoSIk0xbJov+6 NR77TRn8gRbLKeB5IveWXL1USivB7w+usJTBZZJKtYSSF0JdeOIpnRNaMuvWlxrCpdCcTAgPnWD DfVCqSMxeiG486qHTDfpcgWz3VxJbj2wSds68XqbPuDbQFOvmptPCu8N2YqaZZdbIIXKUpWk+jn dzjzfz+KxJMHDlqn+fIfvWLmCjtn8h/BCCRewx2YABQhnH/JWqj9hOe+d6tTsC03626rkV1rbau 034epC6xpDDMR3+LcL/sZXc4eelnsInSqfri6EElvbQu7VHYOoOmC5497BXMf0DzV6BicM6brhd oXWbMPI9z+lh0w8uE0enK5d6Uzf2AkLyRNwUCM/GtSWeFxlopJ4fWNa5qyt7vIQZmN8r54ff5cu gYGKRYzEhUpMi7xHh0zNJVsAYemzL08CpTRGB174TcLNcsR7wHNku7mlVYwwFD44eqSO6k+2OyT axPQeBcz34R9p6+ X-Received: by 2002:a05:6402:4590:b0:693:1da1:7e1f with SMTP id 4fb4d7f45d1cf-69378a31fe8mr8529a12.17.1781215871846; Thu, 11 Jun 2026 15:11:11 -0700 (PDT) Received: from [127.0.1.1] ([2a02:2a40:17ee:2900:654c:3df2:2fd9:9b68]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-693751bac6esm41564a12.10.2026.06.11.15.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 15:11:10 -0700 (PDT) From: Jakub Lecki Subject: [PATCH 0/2] usbip: Cleanup of sysfs attributes. Date: Fri, 12 Jun 2026 00:10:57 +0200 Message-Id: <20260612-usbip-attribute-cleanup-v1-0-8de3aa76867e@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3MywqAIBBA0V+JWTeQgr1+JVpojTUQJj4iiP49a XkW9z4QKTBFGKsHAl0c+XQFoq5g2bXbCHktBtnItmmFwBwNe9QpBTY5ES4HaZc9dkooM1gr+05 CqX0gy/d/nub3/QDBMDY7aQAAAA== X-Change-ID: 20260611-usbip-attribute-cleanup-7515b9ff2872 To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Lecki X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2459; i=lec.jakub@gmail.com; h=from:subject:message-id; bh=Db/rTwmKYyYUA2cN2B39+KKMbD3gbRUp99qdLPL5iGk=; b=owEBbQKS/ZANAwAKAXFnMxNuLeadAcsmYgBqKzJ7MoOi+eT5Os9yBXuAlU2o0i2HnbhiHFDef 44ArsU3vl+JAjMEAAEKAB0WIQTignGL6YrBw4GbwvJxZzMTbi3mnQUCaisyewAKCRBxZzMTbi3m nWC9D/4vrXcNjhsp1rfOqOYCbpHRZ8GD7bq5YevKB+OfsVRQMkCdY9ayD9tLf8VG0GveRrz8SZg 2fJuOX3IlOUfuHl98cdGQwxg/AGWhRrFjm20d1bZs8vCDdU291taQQgtqTFo5sRTk68CVO5YeEg FTUybi8fcWwMuujJdMCrG4h26E9emYzUXshBEliDtu2MJglqOE/08LPOqpJMfmb3i/X2GtI6Ku0 bUtVyV07dwoZGvfBInbyVcB6/2zFxxNj9hjeJ9tBwirO8mZHHL1W7H5QlyoV3c/YMKlibkpE7fh gg1rrpk/bFRExj29HTO8Us3VclZNPfq+4r/N6VjZ7HFKPfx2CQ59oEKTLNHDBkQEJugP967sQr1 EeFCNl+ENfSw/9UebqSN1sEAiHdV+dWSit9tb/kxNT4C41MnXwY/Yqiyr7XsQCe1L1af5g7Eyhl /shWPch6gReUTKdpjMLkbPL7He+Le3JcxHebBvF5KLhcG4eS1sv5hFFC6uyZnI+LHJ5e1du+TVH FiXYz/UEuX3zXWg9f1pT2J6RbqRJbYagLSrG8YCKXe0s9EEWlWPUI87IdsxhnThqv0LwILDt/aj UoHB7SNiiWc7ISBHX/nSvihbyj3XuHyvvrg6EbPkUNw3r9ZvZNyTh6gfQ9MMYYOg4VcBmbWHQzN XekAmePsmaCwlsg== X-Developer-Key: i=lec.jakub@gmail.com; a=openpgp; fpr=E282718BE98AC1C3819BC2F2716733136E2DE69D Hi! This patchset is a prerequisite and a follow-up to my previous proposal to parameterize the number of vhci controllers and the number of ports [1], where Greg suggested that new parameters should be implemented in sysfs/configfs. Before doing that though, existing sysfs attributes must be cleaned up as it's very unintuitive in present form. First commit aims to align `usbip_debug` attribute that is shared between drivers, to the expected usage. It controls the global debug flag, therefore creating multiple instances of it in all of the driver's devices makes no sense. At the same time it also allows to get rid of manual attributes creation in vhci_hcd drivers in the next commit. The second commit segregates the existing vhci_hcd sysfs attributes. Before it, the first vhci device was used as an 'user interface' to the driver. That required recognition of the first device and custom handling in usb controller start function. With this change, the driver-level attributes for attaching/detaching and getting number of ports are defined as driver_attribute, and `status` attribute is automatically created for each of vhci devices. Thanks to that, future implementation of parametrized num_controllers and ports will be much simpler as the fist device doesn't need to be specially handled and doesn't control other devices which are now handled by the driver. [1] https://lore.kernel.org/linux-usb/20251104113248.223594-1-lec.jakub@gmail.com/ Signed-off-by: Jakub Lecki --- Jakub Lecki (2): usbip: Convert usbip_debug to driver attribute. usbip: Cleanup of vhci_hcd attributes. drivers/usb/usbip/stub_dev.c | 10 ++- drivers/usb/usbip/usbip_common.c | 14 ++-- drivers/usb/usbip/usbip_common.h | 2 +- drivers/usb/usbip/vhci.h | 6 +- drivers/usb/usbip/vhci_hcd.c | 71 ++++++------------ drivers/usb/usbip/vhci_sysfs.c | 132 +++++----------------------------- tools/usb/usbip/libsrc/sysfs_utils.c | 23 ++++++ tools/usb/usbip/libsrc/sysfs_utils.h | 1 + tools/usb/usbip/libsrc/usbip_common.h | 2 + tools/usb/usbip/libsrc/vhci_driver.c | 61 ++++++++++------ 10 files changed, 126 insertions(+), 196 deletions(-) --- base-commit: 9716c086c8e8b141d35aa61f2e96a2e83de212a7 change-id: 20260611-usbip-attribute-cleanup-7515b9ff2872 Best regards, -- Jakub Lecki