From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.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 180E67E0FF for ; Wed, 1 Apr 2026 00:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775003239; cv=none; b=p+3lFs7YdO39ajdTFqF2DKMnk/O0k+XhzpCg+1uDB2TIg6FPw64iaN82ZJG1Pe1lxcgbEzKmRDJD5e1vrPFwxWD1MdfZ9NH4i4e9okEn0YaCWGIz06hYo0g48/qZi3SS6MsIIMWzxyfY4d6z7HRSmMAU87RapuEiwsCW8hPQ7LE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775003239; c=relaxed/simple; bh=Jk3/bt2gmKId4jafshg5W5PzA2Ea3CHOFMbIEjAyTWU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DUqbXbEs30dCDmUsA5Up1o5TtXENDwmDl46a4SShoUxJyE5ij6aSjEVSXVVi2De9L+Xqj4VfJvzsjcAqfPlKq47AVAza0eHSkEkMWK1aWs0cy27IZ1nh5BilI+DueMfYUfgll+jJshWuPJ3hGJFPcom9nYL3B1s4B/PDxyr2h80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DJmRkx1z; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DJmRkx1z" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-7d7653db148so3417667a34.2 for ; Tue, 31 Mar 2026 17:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1775003237; x=1775608037; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IvFlcB6AQtRta0LEWu5k7SRnOgWWnnSTlXIjEhCSbfY=; b=DJmRkx1zj5sttZYEkuKhkLoYLhitcJbkeFGOQ31PIGCfmMmVBFcpcXNnbGm4zZ2MmL v5VpN3WffB6zu3ME1GIVSr0eQAaQhuWPK6+Qhlg+jpR1Oxw+m61C2xg5SRoZe8vgbxon Q29KHfzLF4cY1H0s+Kc9GW/GeOytsFpkyQYX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775003237; x=1775608037; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IvFlcB6AQtRta0LEWu5k7SRnOgWWnnSTlXIjEhCSbfY=; b=FQGge00CxlnHF4DG0tCvKmA2acFXAQqTs+1gmez/QA8ACMEknbvth5xB6IAi7hD7Du p8fBC8jOOaoO1Be3W0aCTBzmWfh873FsG35kZHZ0qG6BqShMlDKDGNp7zebMERUjAUrE /J9vQIUjbLsrggFXMNiZYP9Z8n+m84UFYVlffefBVvYTumEjVaqKIENKJl8siM7kzN5+ +9rCLP2/hq6SA+Zj+GvKpMBWWE+Re/jaboFAytHEdRWtpRSwbngYgVgxg9E6J5IFnUat 3hkvGKLDn5d2EAbYvJpAEaLllAqAJ+QM7taxL96kAxvAxwYB0hid7z/QyWGBo59KwuRM j5rA== X-Forwarded-Encrypted: i=1; AJvYcCVL1LsfjuHwBvp0ce+8Bod10PCGJtFDJ9GHVlixjtUXAo1bJ4RUELFcO4KKwuD9cYUiCFlmtlYfQ/AdHvc=@vger.kernel.org X-Gm-Message-State: AOJu0Yxzlik+WnSWQrpeDLm6sh09u+LzEDvrtHVZgvnsqr0yQwnqDK+f FFPDYfxnvdVbOmofm04mqHV0B1mkoA5a4bL/xdm99HL6/fcBXN/qJca6bsC+/9AZ3a0= X-Gm-Gg: ATEYQzzQBbKtCnShM2ebxczXeUSiaCOmnHqQlAGXJK+d7zct+mGc4LF39jXPs2497eU eNkrYwj2kQJOF3C1cjCg12RXvFCw5Sw69l7cTV3uBHEE0HHqg5nUjHDfT21ePXv05vHyM+4J5q0 NH3oHaFpqQ7qEIawbq4bJcb5QHbqipd5eMWtoi37t5eTTWsSg2Ih4H+3z8XE+CKRYX+DcX3kwe6 07t3SDI2FDj2/qM86oWEQ+uJhaJTWvhBtxvIg2bNNO5k8RGnXvedWBOUaFCQg0h13n3k8+gFT6X UDOtF6+QrCyUQUCmcGghB3/NMqUduVTMoM5V9G32ZJwjHLwoby4ufk+d582/80zvm3VmTryujex 0BbjSTRTQArfvYdFjMQ0rnV7SCp5NJSD7m+tR1jbv2jzamPMS5PTEEH3j6MVCV/4gMbOUEeT3Yu FV6JGL6dNS05m9uhVOUAC8MAv9JJmN3rEzquM= X-Received: by 2002:a05:6830:210c:b0:7d7:f700:fec1 with SMTP id 46e09a7af769-7db99425c78mr1250125a34.32.1775003236818; Tue, 31 Mar 2026 17:27:16 -0700 (PDT) Received: from [192.168.1.14] ([38.175.187.108]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7da0a3b2e37sm9617912a34.10.2026.03.31.17.27.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2026 17:27:16 -0700 (PDT) Message-ID: Date: Tue, 31 Mar 2026 18:27:15 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] usbip: tools: add hint when no exported devices are found To: Zongmin Zhou Cc: gregkh@linuxfoundation.org, i@zenithal.me, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, valentina.manea.m@gmail.com, Zongmin Zhou , Shuah Khan References: <3ff00e2e-1c45-45be-a65c-16da9b2ae5a5@linuxfoundation.org> <20260331095830.124543-1-min_halo@163.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20260331095830.124543-1-min_halo@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/31/26 03:58, Zongmin Zhou wrote: > From: Zongmin Zhou > > When refresh_exported_devices() finds no devices, it's helpful to > inform users about potential causes. This could be due to: > > 1. The usbip driver module is not loaded. > 2. No devices have been exported yet. > > Add an informational message to guide users when ndevs == 0. > > Message visibility by scenario: > - usbipd (console mode): Show on console/serial, this allows instant > visibility for debugging. > - usbipd -D (daemon mode): Message logged to syslog, can keep logs for > later traceability in production. Also can use "journalctl -f" to > trace on console. > > Suggested-by: Shuah Khan > Signed-off-by: Zongmin Zhou > --- > Changes in v3: > - Just add an informational message when no devices are found. > Changes in v2: > - Use system calls directly instead of checking sysfs dir. > > tools/usb/usbip/libsrc/usbip_host_common.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c > index ca78aa368476..cd92baee310c 100644 > --- a/tools/usb/usbip/libsrc/usbip_host_common.c > +++ b/tools/usb/usbip/libsrc/usbip_host_common.c > @@ -149,6 +149,13 @@ static int refresh_exported_devices(struct usbip_host_driver *hdriver) > } > } > > + if (hdriver->ndevs == 0) { > + if (!strcmp(hdriver->udev_subsystem, "usb")) > + info("Please check if %s driver is loaded or export devices.",USBIP_HOST_DRV_NAME); Check coding guidelines and match the new code to the existing. Need a space between the string and the next argument. > + else > + info("Please check if %s driver is loaded or export devices.",USBIP_DEVICE_DRV_NAME); When will this be true? Isn't refresh_exported_devices() called from Thinking about this more, since you have to differentiate between host and device, it makes sense to make this change to usbip_device_driver_open() and usbip_host_driver_open() There is an err() message already in both of these routines. that prints the right information. You can check hdriver->ndevs == 0 and add an info that says load appropriate modules or export devices. This way you don't have to add logic to refresh_exported_devices() to figure out which driver. thanks, -- Shuah