Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1836433rdb; Sat, 2 Dec 2023 11:12:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWbGkILsvQHuablBWX5yIe20qhePZcFBGdW5iqayY0B/sXAz3EL6S/KHgHp13tAlFYC0QM X-Received: by 2002:a17:902:f68c:b0:1d0:76c2:e356 with SMTP id l12-20020a170902f68c00b001d076c2e356mr1323506plg.51.1701544361057; Sat, 02 Dec 2023 11:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701544361; cv=none; d=google.com; s=arc-20160816; b=k09jAP2DhxZhwcYRgv3WhD0tCGSiDPlj5H+BVnybQibdFZE0L7++gm4UHNCgPQUB7K nfbYmYKj4GJPv9gTGlrHfAaBHQxaKxYG/+OTyvCdV2yAUpK0bKI+AAUuPlFKi/MV2Mo+ wEYAT1ZYPv1TdJ0lhNQxW0s3NYxtm4vGhMbqnYX+M7Gc6r1F0QckevPfMMQ1ResMmJoz 5D++3xBStbKHJEUbLc8UsZSDVUe1OZxXWRD38TU1S5L/RMiLQEHqN4Tdtw0ENVDuXW5Z ATv3PEto0TZsdzIMo4aiUmi5wCSMrJwrw5D9Ecdw2mGbMPpwsfn71abzvYUS7HqXB3sX Jh+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:organization :subject:cc:to:from:dkim-signature; bh=DVj6YU5qtsVR8CtNxuUON4OVY9fj7B5VUSDFcJFPxsc=; fh=PSohNbiwZ12zQ5NfjLk3KO17mw59K8eZOgZUifHAk0Q=; b=H7XMUVCQC5gb/Q/JChTpBEE7Oao3JBArHKDlauRke0aa/7qQKOFCQHRVoiMOSxg4cV FHPEVPoYC6yAKSOha9UJX8IuPWy6e24l433TVqZXF1YWWmP00CieFsjvs/FksueMF0Gf l+EYdMH+ItYmX+QpiQJ1pED1lPH5stkNmdiZi4tXg8Nwtrst/QipDqAla8IHP+VnJdAj V6h8PR+nw82ILT8kBrDzbd1nzTMknBPye+mBc0a4+0GHLMaOWvJw85o20ZwRyeZ0aE40 NSE+Rt9J8+Wkw7AmZ1PIEhtjj9Jzrk02XfdCb/hczgrNyOTYede7LV0pGDU0yJuHZ8T7 IGcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=BNEneLrD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n11-20020a170902968b00b001cfa6128913si5323882plp.115.2023.12.02.11.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 11:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=BNEneLrD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3E25F80681C0; Sat, 2 Dec 2023 11:12:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbjLBTMQ (ORCPT + 99 others); Sat, 2 Dec 2023 14:12:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLBTMP (ORCPT ); Sat, 2 Dec 2023 14:12:15 -0500 Received: from dilbert.mork.no (dilbert.mork.no [IPv6:2a01:4f9:c010:a439::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11EEA119; Sat, 2 Dec 2023 11:12:19 -0800 (PST) Received: from canardo.dyn.mork.no ([IPv6:2a01:799:10da:6900:0:0:0:1]) (authenticated bits=0) by dilbert.mork.no (8.17.1.9/8.17.1.9) with ESMTPSA id 3B2JBO88880565 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sat, 2 Dec 2023 19:11:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1701544278; bh=DVj6YU5qtsVR8CtNxuUON4OVY9fj7B5VUSDFcJFPxsc=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=BNEneLrD5oxC5cNuSB4I+lKiQPEamtsH0h7+LndKpz0Dy28OUzdJv4/2dPQGO+AYl PtF5zZe9JUNOJx8JzhRDKR4ef2S6keVBNutDdBDpJM7+YWJlAp90YxZZWservazW4i 0uZ9YMwYR4atd7kPJuTpbjBr+b26/yTV/+TiUhLY= Received: from miraculix.mork.no ([IPv6:2a01:799:10da:690a:d43d:737:5289:b66f]) (authenticated bits=0) by canardo.dyn.mork.no (8.17.1.9/8.17.1.9) with ESMTPSA id 3B2JBH5A3964449 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sat, 2 Dec 2023 20:11:17 +0100 Received: (nullmailer pid 3179962 invoked by uid 1000); Sat, 02 Dec 2023 19:11:17 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Douglas Anderson Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Grant Grundler , Hayes Wang , Simon Horman , netdev@vger.kernel.org, Brian Geffon , Alan Stern , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] usb: core: Allow subclassed USB drivers to override usb_choose_configuration() Organization: m References: <20231201183113.343256-1-dianders@chromium.org> <20231201102946.v2.2.Iade5fa31997f1a0ca3e1dec0591633b02471df12@changeid> Date: Sat, 02 Dec 2023 20:11:17 +0100 In-Reply-To: <20231201102946.v2.2.Iade5fa31997f1a0ca3e1dec0591633b02471df12@changeid> (Douglas Anderson's message of "Fri, 1 Dec 2023 10:29:51 -0800") Message-ID: <87wmtw2ze2.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 1.0.3 at canardo X-Virus-Status: Clean X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 02 Dec 2023 11:12:38 -0800 (PST) Douglas Anderson writes: > The r8152 driver tried to make things work by implementing a USB > generic_subclass driver and then overriding the normal config > selection after it happened. This is less than ideal and also caused > breakage if someone deauthorized and re-authorized the USB device > because the USB core ended up going back to it's default logic for > choosing the best config. I made an attempt to fix this [1] but it was > a bit ugly. > > Let's do this better and allow USB generic_subclass drivers to > override usb_choose_configuration(). > > [1] https://lore.kernel.org/r/20231130154337.1.Ie00e07f07f87149c9ce0b27ae= 4e26991d307e14b@changeid > > Suggested-by: Alan Stern > Signed-off-by: Douglas Anderson Brilliant! Thanks for doing this. It is obviously what I should have done in the first place if I had been smart enough. Bj=C3=B8rn