From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 2F5233FE678 for ; Fri, 27 Mar 2026 17:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774633897; cv=none; b=OPC8G1xS1Hk1Wd0L12zHyo6FJssb2w96Yd7vszmtJJbAquZFAr/yzYgGzdyu+GslG/EubLKgzPDdOICHyT3QSlJHjBMNXmS/f9bwgFQ6hI+qBDynnjGyEHk9XaesBlR/NnhnudSCOoRgKXuGQZBw4MTJJF3Vc4Uqj5Y8CfabGm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774633897; c=relaxed/simple; bh=6dvKrKmkak8ATPLkEYmgP3R55cJ1kt9/4AYxcNX/tzo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RJfQyoCv+Zev/u/VAQrrju0t7PReb/fLghf5H3GQ/3VH6ISeU34W31vHxA2mDZIzOV+FpLEWA5ylGO7dXfUAGD8iVkIG5ZCNyoJWI2kXOx4Jofpw026JkPnRaAT0whoEBAhKIA0UIwtX+Z7xc6vJZWcPfZcco+wSz0Mdq27zpQ8= 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=dAvgQ1vy; arc=none smtp.client-ip=209.85.215.180 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="dAvgQ1vy" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c76682712b5so867356a12.3 for ; Fri, 27 Mar 2026 10:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1774633895; x=1775238695; 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=XpqybzqqhB2MoQ2BAD3bJ2UJHtB+MkMas0fVHP2RkHo=; b=dAvgQ1vyrgSf+Zq00k+R87MiulUe047P3Jy/1tj0AJMISo5pcJcu0kdtihxfCfHBEk 2agv0J7NwZByAkEX06ZgsxRXRXfrmsBqfFpkq1FFfKpw9UM7vnyyILP+VG12m3I3KjFi NrZdRW+aHoVSy3RJXsUehaqiCETWis6xP2k90= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774633895; x=1775238695; 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=XpqybzqqhB2MoQ2BAD3bJ2UJHtB+MkMas0fVHP2RkHo=; b=Rsn7D82rZd6ZG3VsDhqQFy251OQKvilL/6LaItPzvWdEafDteMmosd4zY6sSaMxmdr qKWehga53diYujCSr4ynTFMRbt1rpILPJaxJ4U958636WGpa1RuiOEHJ690iNsPKb0j2 ZNf8nQiJJ8yeSNlnYWt2WcZJS3LmsZdNly3WusdWEvM10a5gw70+1Sd3gPek4Tf+VNgl Subeg2AkC7Pk+aJXlg06Osx0/ppPfjts4eUZcllpjotVM8DNj4VDu77uY2KRVMiMDkIF kd9MPJwk54IznLkUTbqYM597kbzCjDthu+vu9dl2GTGru8P2ySymhe+YkxPxrcszUly/ LLRw== X-Forwarded-Encrypted: i=1; AJvYcCVELzgk4o75iLY6qsTKhsDe8TYBts/rEWElR9c/tt2j+3b/XL+i2wUwbXPdZWGh3YyMWRdsKV6jwMwZPS4=@vger.kernel.org X-Gm-Message-State: AOJu0YwLCjy2yRLw1X/x1o2LsrUydIaghdddLNdaq3XkYU++pzpGZpeR TIIzKi+FiYUbvkdJKuyyVOYNyqoQqancBU6tnfYhBff4ViKXyXsMIrbZM5jHxjp4Ifo= X-Gm-Gg: ATEYQzzGBb5jjWD+ySBEm9ngJS2zqUQjxZxthxg61qqcfGRU+HmU9+BeKEmnylxQO2N zEs17dYt7gcHZDQ4xTGeUDuCYZDiUmB2ZKTq5T1ltpV3Mr9O76yPqJTzdK2ut+8HQjcGkBQ0ySi tj0FH/u2/EWS5JrsjJkXt7Ejo3wG6Nef1U3Aan7nvEtispwkn2BMPW2IEm6ytzmwM2pY0NuCDnL rEyzVwWUad8D8YYLuQpFwVMrgeV44CCwcvKv4arWNjMk+DpuCgEsa6QQrM6mqXeAuIrfplwzH7J obIGn/2JBPwEB7Ux5Dem0I6drVMdi76dSqGT4t5TyN7asVnA6i35kYZHK9BS2RqwHYYBrqNKpst IWdC64CEMUK2g8v5snUhFyEcSv3ygUgfgr6adOQwIdH14SLhKW8LPccztyO+PCCjr0T/er7SAlB mA0p5vJe4XrQmd2FAvcDLq1kaAHD91NnLSqOE= X-Received: by 2002:a05:6a00:4191:b0:82c:70a8:faec with SMTP id d2e1a72fcca58-82c95eaa436mr3211849b3a.21.1774633895370; Fri, 27 Mar 2026 10:51:35 -0700 (PDT) Received: from [192.168.1.14] ([38.175.187.108]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82c7d3fa0a8sm5953548b3a.58.2026.03.27.10.51.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Mar 2026 10:51:34 -0700 (PDT) Message-ID: <28dd623f-43f6-4d43-bf7e-41b8c771a954@linuxfoundation.org> Date: Fri, 27 Mar 2026 11:51:32 -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 v2] usbip: tools: Add usbip host driver availability check To: Zongmin Zhou , Greg KH Cc: i@zenithal.me, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, valentina.manea.m@gmail.com, Zongmin Zhou , Shuah Khan References: <29c03d8b-c73b-4393-95ff-bbf5c31df86e@linuxfoundation.org> <20260325022634.279624-1-min_halo@163.com> <2026032555-headrest-example-af16@gregkh> <1fdab10a-86f0-454a-af10-396a53169ea7@163.com> <2026032615-donated-chaps-9eac@gregkh> <1e974e1d-afdc-41a5-95a7-45e19e77a087@linuxfoundation.org> <722d5e64-a4d8-4ab2-954d-22f9b67f8f4e@163.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <722d5e64-a4d8-4ab2-954d-22f9b67f8f4e@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/27/26 02:39, Zongmin Zhou wrote: > > On 2026/3/27 02:43, Shuah Khan wrote: >> On 3/26/26 02:43, Greg KH wrote: [removed text] >> >> The problem Zongmin is trying fix ish when usbipd starts, it looks for >> exported if any - if it doesn't find any it assumes there aren't any >> exported and doesn't detect that usbip_host driver isn't loaded. >> >> refresh_exported_devices() doesn't have the logic and it shouldn't >> include that logic because this hook is called periodically to >> refresh the list of exported devices. Starting usbipd and loading >> the driver are distinct steps and without any dependencies. >> >> This patch he is trying to add that detection so a message can be printed >> to say "load the driver". >> >> A message can be added easily to cover two cases: >> >> 1. usbip_host driver isn't loaded >> 2. There are no exported devices. >> >> refresh_exported_devices() will not find any devices in both >> of the above scenarios. It isn't an error if it can't find >> any exported devices. >> >> An informational message when refresh_exported_devices() >> when it doesn't find any devices could help users. >> >> Zongmin, >> >> Would adding a message that says >> "Check if usbip_host driver is loaded or export devices" >> solve the problem of hard to debug problem you are addressing here? >> > Shuah, > > Your suggestion makes sense. > Adding an informational message when no devices are found would be a simple > and clean solution that helps users debug without being intrusive. > > However, I plan to add the info() message in usbip_generic_driver_open() instead of > refresh_exported_devices(), because: > - usbip_generic_driver_open() is called only once at initialization. > - refresh_exported_devices() is called periodically to refresh the exported device list. refresh_exported_devices() isn't called periodically - it is called from usbip_host_driver op: refresh_device_list and it will be called whenever usbipd (host side) calls it whenever it receives a request from user-space via process_request() For example running "usbip list -l" command will trigger a run of refresh_exported_devices() via usbip_host_driver op: refresh_device_list I don't think it will that noisy to add a message to refresh_exported_devices() when device list is zero. Currently the logic doesn't detect device list zero. You have add that condition to print informational message. > - When the server has no exported devices, having zero devices >   is normal and not worth frequent info messages. That is correct. Zero exported devices isn't an error and this could persist until devices are exported. > > Theoretically, we only need to prompt once at startup. Is my understanding correct?> > I'll also remove the existing error messages like below, > since they cannot accurately determine whether the driver is loaded: > > if (ret) >     err("please load " USBIP_CORE_MOD_NAME ".ko and " >         USBIP_HOST_DRV_NAME ".ko!"); Leave this one alone, because it gets called from a couple of places. thanks, -- Shuah