From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 593633176E0 for ; Tue, 10 Mar 2026 21:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773179505; cv=none; b=azcNHMi0D3ZZ/88+lyy+xG38xj8/OIUeIM5svHgLrENIt0JKc69UKERLskR9hpyF1QIMnfrP8x58FjIO/jbsscQyEpH7AQJ2frtZvLZPz/sOpJKknrSiUOmi1vijjiL6uRe7+PGGZyRzexr0Y1JKY31CRgHeIWMKQc2ndxrJRpo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773179505; c=relaxed/simple; bh=5jFwpdm4F865nFToowbZNNLOqXArLK8lbWEAUbeUW1I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BWC1bp/o4kPJvaDWEhz/wZ+3IrmzzhP3617XyjUZnscKZdIs9ZjlqntaQZd2j9jzLoebZafulWcA0yRDewWbxqeIZ6fboHYgxHvWsrvCZwCMucs+3P+YvJujBPljKOljZJ9wMtYX3zTCGWuK7T9Dl8SUPycAZ2xCYazWkDmQEsw= 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=agrDekfh; arc=none smtp.client-ip=209.85.219.51 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="agrDekfh" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-89a465bd7edso25033666d6.0 for ; Tue, 10 Mar 2026 14:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1773179503; x=1773784303; 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=L1vUhAEqcvWgjmawKDwZyP12GKPpRd3m8G2VHGenhtM=; b=agrDekfhGyn84snMnaTOrjCVaaYaLMJuTIDtVeMb8Ej+iVXArWLdlQp20vWTATMEQO js6xptErlDXnt/glcGY579KEm/HUR4t30dLWhEtw3IbfflFOGEj3OEk0Y1k7fuZoQryL +3e7WqALqCulVU9wTx8aTfRlaBi7/7lvNQoAU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773179503; x=1773784303; 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=L1vUhAEqcvWgjmawKDwZyP12GKPpRd3m8G2VHGenhtM=; b=ueMD2XjYljO2sgSvxqKkTsbUVdWz5NxBr5cKHAWU+EgnsVlE72gf1evDvN38zhpTMC dkYpzCR2iTO/UFDqqWYa+uMhhTpI06VQtsWXzTC2U4zldCeMZMN/HOkTi125pCNEqkhK A8RjlTmr+kuIpZGkfXic+Z3q098Txnt7BSqndl375nuQ3xNIP6wpOXFhhLuNPsc/PX2F MNHomOoxW80SSWzeCWRyR8v99nqdsmM42tH/Aw5OeSwBrlWzL5/1y9/wChwZQf1LRVpX 2BxdpduBvGZUddZEJJvFh0ngNA7eWGk+9jmxh33CujxaF/AP7X+c93FdRBXBQ/7/im2O rOOw== X-Forwarded-Encrypted: i=1; AJvYcCVbD+C5VtXeVYHPzXlLJ6wjBzO6GUswdDmaPpLxv8+630p1uY3JwoSywGLgEvd8cctOEhJWF2ZYW3o7PqI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6+xEnX/voLiYV4rqtjdHP4fQmtUK4RUzkqPotJIDXtgJrhJNI 1xKK4turhQOwwhRWkpkflREr6YSrhLuZ867gk89ICwzFq+opYD6AaNKhB7CsgpKnGsY= X-Gm-Gg: ATEYQzyesjPV4BtPSX9uW6s2EQQimuVV9riNZBhc2/RmDg/zdfK6A2ccbmWkfpvyXuR WqJ5fk2o9m+RSbdpXzYB2/ufRA/+0jB7ksTfL8g9EnwUTuGdyaAadXNyIjDrrfIKycmFnwdLR8D xZxAywmGmf1P1yHo727NQW9XKbs5z1h2Sbiqz9U8Xspmo0tqLeN38qRjziLrmhJKrS4UXR5WhVO IZpra3hU1ZPi8npGNHARTnKlE6knlVZuoY2HpWlH46QKkKgIHK9vC0vZZ0pkQYEeGgvdxXLFMYL FWMXYIA0qnSY6h3f5eJMoF9OsiWKXUSKxhFJ0O9aIQqKpMpcXavIib/uhzMefKniYG53ou4w6o9 Lm8xQJZo4mfJa9YneJ6jD67s6fiuVujnwir4a6CZo7AEdjwA4UNyia62pyNH+a2DXomZ6Tti2VX Cu7dzO+fCd2kYJs9h+b1jgFIlmFv7j/TYPy00= X-Received: by 2002:a05:6214:242e:b0:89a:321:a198 with SMTP id 6a1803df08f44-89a66a8affdmr2399896d6.45.1773179503269; Tue, 10 Mar 2026 14:51:43 -0700 (PDT) Received: from [192.168.1.14] ([38.175.187.108]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89a65d2160asm2176056d6.52.2026.03.10.14.51.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Mar 2026 14:51:42 -0700 (PDT) Message-ID: <55fcc500-afa5-4ee7-bde8-c5eec6932764@linuxfoundation.org> Date: Tue, 10 Mar 2026 15:51:41 -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 2/2] USB: usbip: drop redundant device reference To: Johan Hovold Cc: Greg Kroah-Hartman , Bastien Nocera , Valentina Manea , Shuah Khan , Hongren Zheng , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20260305133851.2952-1-johan@kernel.org> <20260305133851.2952-3-johan@kernel.org> <9d727cd2-701e-4c5b-9646-82874f2d0a4a@linuxfoundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/10/26 02:35, Johan Hovold wrote: > On Mon, Mar 09, 2026 at 02:26:03PM -0600, Shuah Khan wrote: >> On 3/5/26 06:38, Johan Hovold wrote: >>> Driver core holds a reference to the USB device while it is bound to a >>> driver and there is no need to take additional references unless the >>> structure is needed after disconnect. >> >> In this case it is necessary for stub driver to hang on to the reference >> to maintain exported device status. > > But the driver does not hold on to the reference taken at probe after > disconnect returns. The stub device itself is even freed at disconnect > and cannot be used to release the reference. > > Which exported device status are you referring to here? I am referring to the device status that usbip host exports to the client side. The interaction between host and client is handled from stub rx, tx, and also event handler. Having the reference to the device helps so the device sticks around until the stub driver no longer needs it so we don't see use after free type issues. thanks, -- Shuah