From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A60C36FB1; Tue, 5 Dec 2023 02:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GnjCYzED" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BB53C433C8; Tue, 5 Dec 2023 02:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701743262; bh=K7+Z4PmTJherMA+QfJtZKMnSBDi8EWhFiIph/biZs1Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GnjCYzEDhafwXJKdGsMy2PneJB0YNeXvuZtnK43lHxTsfsr0O/w/N02fAfPr2x1Dx UjJtyt5OUlXmFMVr9Q3zynakR8YrhStg5Oms6+KAnyEsSbF6iqjlfpYfzwuu+V9DBY uvz4H7It1TmP6xGEo7C7dmYELcctCR1zAFxfM8oJLsPHo0S9Ft0MsQ8EW6ssDbmeTX u0O47vR4EnSbr73fDqCR4Ip8i2rwNt6jcQmxPvtXBjzpZ4QZFsRPlq5UmEHNcrXcs3 S/sDknYjBde6i87gVOQVOLxE8HOTucdrfDkbKgM/JMtCMEFGLtxPBkMwTw613e544a KdGC2/MvZRyLg== Date: Mon, 4 Dec 2023 18:27:40 -0800 From: Jakub Kicinski To: Douglas Anderson Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , Eric Dumazet , Paolo Abeni , Grant Grundler , Hayes Wang , Simon Horman , =?UTF-8?B?QmrDuHJu?= Mork , netdev@vger.kernel.org, Brian Geffon , Alan Stern , linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2 3/3] r8152: Choose our USB config with choose_configuration() rather than probe() Message-ID: <20231204182740.62a49a14@kernel.org> In-Reply-To: <20231201102946.v2.3.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid> References: <20231201183113.343256-1-dianders@chromium.org> <20231201102946.v2.3.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 1 Dec 2023 10:29:52 -0800 Douglas Anderson wrote: > If you deauthorize the r8152 device (by writing 0 to the "authorized" > field in sysfs) and then reauthorize it (by writing a 1) then it no > longer works. This is because when you do the above we lose the > special configuration that we set in rtl8152_cfgselector_probe(). > Deauthorizing causes the config to be set to -1 and then reauthorizing > runs the default logic for choosing the best config. > > I made an attempt to fix it so that the config is kept across > deauthorizing / reauthorizing [1] but it was a bit ugly. > > Let's instead use the new USB core feature to override > choose_configuration(). > > This patch relies upon the patches ("usb: core: Don't force USB > generic_subclass drivers to define probe()") and ("usb: core: Allow > subclassed USB drivers to override usb_choose_configuration()") Acked-by: Jakub Kicinski